You are viewing a plain text version of this content. The canonical link for it is here.
Posted to general@hadoop.apache.org by Alessandro Binhara <bi...@gmail.com> on 2011/03/14 18:48:51 UTC

problem to write on HDFS

Hello ...

I have a servlet on tomcat.. and it open a hdfs and write simple file with a
content of post information.
Well , in first test we had a 14.000 request per second.
My servet start many trads to write on filesystem.

i got this message on tomcat:

Mar 11, 2011 6:00:20 PM org.apache.tomcat.util.net.JIoEndpoint$Acceptor run
SEVERE: Socket accept failed
java.net.SocketException: Too many open files


HDFS is slow to write a file?
How is a better strategy to write on HFDS...

In real aplication we will have a 100.000 request per second to salve in
hdfs.

thanks..

Re: problem to write on HDFS

Posted by Harsh J <qw...@gmail.com>.
You're running into ulimit issues (You have hit the number of open
files allowed for a/the user). It is not an uncommon problem, and some
web-searching should help you solve it :)

http://www.google.com/search?q=Too+many+open+files

Also, do remember to close your open files and file-system connections
when you're done with them for a task.

On Mon, Mar 14, 2011 at 11:18 PM, Alessandro Binhara <bi...@gmail.com> wrote:
> Hello ...
> I have a servlet on tomcat.. and it open a hdfs and write simple file with a
> content of post information.
> Well , in first test we had a 14.000 request per second.
> My servet start many trads to write on filesystem.
> i got this message on tomcat:
> Mar 11, 2011 6:00:20 PM org.apache.tomcat.util.net.JIoEndpoint$Acceptor run
> SEVERE: Socket accept failed
> java.net.SocketException: Too many open files
>
> HDFS is slow to write a file?
> How is a better strategy to write on HFDS...
> In real aplication we will have a 100.000 request per second to salve in
> hdfs.
> thanks..
>
>



-- 
Harsh J
http://harshj.com

Re: problem to write on HDFS

Posted by Aaron Kimball <ak...@gmail.com>.
Alessandro,

I think your requirements are outside the operating envelope for HDFS'
design. HDFS is not particularly well-suited for interactive operation --
it's designed for batch workloads like those performed by MapReduce.
Opening, writing, and closing 100,000 files/second is unlikely to work on
HDFS.

When users head to your site, why do they need to write files in HDFS? What
do those files represent?

If each servlet is just trying to log its operations to HDFS, then you
should use a system like Flume which will aggregate the log records together
into a smaller number of streams and then write those to a more reasonable
number of files which are kept open for a longer amount of time.

If instead each servlet is saving some sort of per-user state that you
expect to retrieve in an online fashion, you should look at HBase or another
distributed (key, value) store (there are several options), which will
enable faster retrieval of this information.

Good luck,
- Aaron


On Mon, Mar 14, 2011 at 10:48 AM, Alessandro Binhara <bi...@gmail.com>wrote:

> Hello ...
>
> I have a servlet on tomcat.. and it open a hdfs and write simple file with
> a
> content of post information.
> Well , in first test we had a 14.000 request per second.
> My servet start many trads to write on filesystem.
>
> i got this message on tomcat:
>
> Mar 11, 2011 6:00:20 PM org.apache.tomcat.util.net.JIoEndpoint$Acceptor run
> SEVERE: Socket accept failed
> java.net.SocketException: Too many open files
>
>
> HDFS is slow to write a file?
> How is a better strategy to write on HFDS...
>
> In real aplication we will have a 100.000 request per second to salve in
> hdfs.
>
> thanks..
>

Re: problem to write on HDFS

Posted by Steve Loughran <st...@apache.org>.
On 14/03/11 17:48, Alessandro Binhara wrote:
> Hello ...
>
> I have a servlet on tomcat.. and it open a hdfs and write simple file with a
> content of post information.
> Well , in first test we had a 14.000 request per second.
> My servet start many trads to write on filesystem.
>
> i got this message on tomcat:
>
> Mar 11, 2011 6:00:20 PM org.apache.tomcat.util.net.JIoEndpoint$Acceptor run
> SEVERE: Socket accept failed
> java.net.SocketException: Too many open files
>
>
> HDFS is slow to write a file?
> How is a better strategy to write on HFDS...
>
> In real aplication we will have a 100.000 request per second to salve in
> hdfs.
>
> thanks..
>

Aaron is right, your expectations of Hadoop HDFS are probably wrong, but 
you haven't got that far yet, you are running out of socket handles, 
which is because you need to increase your ulimits so that more sockets 
can be open. Search for the error string you've seen and you'll find 
details on the problem and various solutions -a problem that has nothing 
to do with Hadoop at all.