Re: [Simpleweb-Support] Speed in serving requests
Brought to you by:
niallg
From: Niall G. <gal...@ya...> - 2007-03-11 13:54:49
|
Hi Oscar,=0A=0A=0A=0ATypically I can complete approx 3000 requests per seco= nd on a 2GHz=0Apentium centrino on linux with about 1000 concurrent clients= serving an 8k image. It is impossible for me to give you an exact configur= ation as I do not know how you are measuring response times, what client yo= u are using, or how you are serving your files. I would experiment with the= following:=0A=0A1) Remember simple is not a servlet container, at its core= it enables asynchronous processing, which makes it very different from a s= ervlet container. This adds an extra requirement, you must always always ex= plicitly close the output stream like so.=0A=0AOutputStream out =3D resp.ge= tOutputStream();=0A// your code here=0Aout.close(); // always close when fi= nished=0A=0A2) Test with each response having a "Connection: close" set in = the header, like so=0A=0Aresponse.set("Connection: close")=0A=0AIf this imp= roves performance, then you know client requests are intermittent.=0A=0A3) = Ensure that your maximum idle time for a connection is low, this means you = need to create a PipelineHandler from the PipelineHandlerFactory=0A=0AProto= colHandler proto =3D new MyProtocolHandler();=0APipelineHandler handler =3D= PipelineHandlerFactory.getInstance(proto, 10, 100)=0A=0AThis ensures that = at most an open connection will be idle for 100ms. This feature will have m= any improvements in the next release.=0A=0A4) Use buffering output, this en= sures that interaction with TCP is good=0A=0APipelineFactory factory =3D ne= w BufferedPipelineFactory(2086);=0AConnection connection =3D ConnectionFact= ory.getConnection(handler, factory);=0A=0AExperimenting with these should p= rovide you with some clues as to why you are getting poor performance. =0A= Niall Gallagher=0A=0A----- Original Message ----=0AFrom: Oscar Perez <os_ca= rp...@te...>=0ATo: Simple support and user issues <simpleweb-support@= lists.sourceforge.net>=0ASent: Sunday, March 11, 2007 3:09:14 AM=0ASubject:= Re: [Simpleweb-Support] Speed in serving requests=0A=0AHi,=0Aserver load w= ill be about 10 to 15 clients (it's a closed system) =0Aissuing continuous = requests (basically thumbnails pages) and I need to =0Ahave load times of l= ess than 0.5 seconds. By the moment I'm testing with =0Aonly one client and= the response time is of about 2-3 seconds, so it's =0Atoo slow.=0AI'm serv= ing files by reading them (with a 4kb buffer) and writing to =0Aresponse's = OutputStream directly. But I'm caching files in memory, so =0Afiles are onl= y read the first time they are requested. I'll try =0AFileEngine and test i= f it improves performance.=0A=0AThank you very much.=0A=0A=D2scar P=E9rez= =0A=0A=0AEn/na Jeff Nichols ha escrit:=0A> Hi Oscar,=0A>=0A> Where is your = performance issue? Raw speed when handling a single =0A> request, or only= under load?=0A>=0A> Also, how are you serving those files? Are you readin= g and writing =0A> them manually, or are you using the built-in FileEngine= ?=0A>=0A> Jeff=0A>=0A>=0A> On Mar 10, 2007, at 1:18 PM, Oscar Perez wrote:= =0A>=0A> =0A>> Hi,=0A>> first of all, I would like to congratulate Simple= web's creators for=0A>> their work. Now it's really easy to embbed a web se= rver into an =0A>> existing=0A>> Java application.=0A>> But I've got a que= stion: is there a way to tune performance. I mean,=0A>> I've implemented a = server with just one service. This service simply=0A>> reads files from the= filesystem and returns them to the client. But =0A>> I'm=0A>> unable to a= chieve the required performance and I wonder if I can =0A>> tune it=0A>> t= o be faster.=0A>>=0A>> Thanks a lot for your help and congratulations again= !=0A>>=0A>> Oscar P=E9rez.=0A>>=0A>> --------------------------------------= -------------------------------- =0A>> ---=0A>> Take Surveys. Earn Cash. In= fluence the Future of IT=0A>> Join SourceForge.net's Techsay panel and you'= ll get the chance to =0A>> share your=0A>> opinions on IT & business topic= s through brief surveys-and earn cash=0A>> http://www.techsay.com/default.p= hp? =0A>> page=3Djoin.php&p=3Dsourceforge&CID=3DDEVDEV=0A>> _______________= ________________________________=0A>> Simpleweb-Support mailing list=0A>> S= imp...@li...=0A>> https://lists.sourceforge.net/l= ists/listinfo/simpleweb-support=0A>>=0A>> =0A>=0A>=0A> ----------------= ---------------------------------------------------------=0A> Take Surveys.= Earn Cash. Influence the Future of IT=0A> Join SourceForge.net's Techsay p= anel and you'll get the chance to share your=0A> opinions on IT & business = topics through brief surveys-and earn cash=0A> http://www.techsay.com/defau= lt.php?page=3Djoin.php&p=3Dsourceforge&CID=3DDEVDEV=0A> ___________________= ____________________________=0A> Simpleweb-Support mailing list=0A> Simplew= eb-...@li...=0A> https://lists.sourceforge.net/lists/li= stinfo/simpleweb-support=0A>=0A> =0A=0A=0A-------------------------------= ------------------------------------------=0ATake Surveys. Earn Cash. Influ= ence the Future of IT=0AJoin SourceForge.net's Techsay panel and you'll get= the chance to share your=0Aopinions on IT & business topics through brief = surveys-and earn cash=0Ahttp://www.techsay.com/default.php?page=3Djoin.php&= p=3Dsourceforge&CID=3DDEVDEV=0A____________________________________________= ___=0ASimpleweb-Support mailing list=0AS...@li...urceforge.= net=0Ahttps://lists.sourceforge.net/lists/listinfo/simpleweb-support=0A=0A= =0A=0A=0A=0A =0A___________________________________________________________= _________________________=0ABe a PS3 game guru.=0AGet your game face on wit= h the latest PS3 news and previews at Yahoo! Games.=0Ahttp://videogames.yah= oo.com/platform?platform=3D120121 |