pablomelo / subethasmtp

Automatically exported from code.google.com/p/subethasmtp
Other
0 stars 0 forks source link

Too slow socket handling #44

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Our application process accept e-mail using subethasmtp, extract text using 
apache tika and index it with lucene. But profiler show, that a lot of time 
spent in subethasmtp socket reading (about 50% of total time, tika takes just 
17%, for example). 

Is the any way to improve socket handling performance ? 

PS. We use Linux x64, 8 cores, 24 GB RAM.

Original issue reported on code.google.com by maxi...@gmail.com on 5 May 2011 at 12:17

Attachments:

GoogleCodeExporter commented 9 years ago
SocketInputStream.read is blocking when there are no bytes in the buffer. I am 
not sure whether the profiler highlights this method because most of the time 
the method  waits for data from the client or because the method is actually 
slow in retrieving available data bytes. Do you think that the clients feed the 
data fast enough? If yes, you can try to wrap the input stream with a 
BufferedInputStream in the org.subethamail.smtp.server.Session#setSocket 
function. In that way SocketInputStream will be called less time.

Original comment by hontvari@flyordie.com on 5 May 2011 at 1:21

GoogleCodeExporter commented 9 years ago
Same here, please add BufferedInputStream around the SocketInputStream. :)

Original comment by jerolimov on 18 Jul 2011 at 2:33

GoogleCodeExporter commented 9 years ago
If you have a performance measurement which shows that BufferedInputStream 
brings improved performance than please contribute the result. 

Original comment by hontvari@flyordie.com on 12 Mar 2013 at 12:47

GoogleCodeExporter commented 9 years ago

Original comment by hontvari@flyordie.com on 12 May 2013 at 12:54