Re: [Cppcms-users] Idle time in handling post requests
Brought to you by:
artyom-beilis
|
From: Artyom B. <art...@ya...> - 2014-11-20 16:45:46
|
BTW I would strongly recommend uploading files using multipart/form-data encoding. (Curl supports it well).This way you can upload quite huge files and save them directly to files rather than keeping them in memory, Artyom Beilis -------------- CppCMS - C++ Web Framework: http://cppcms.com/ CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/ From: Dr. Peter Gottschling <pet...@si...> To: Artyom Beilis <art...@ya...>; cpp...@li... Sent: Thursday, November 20, 2014 6:14 PM Subject: Re: [Cppcms-users] Idle time in handling post requests Thank you very much, Artyom. Now it is fast. It remains to do the same within our C++ client with libcurl. But know I know what I have to look for. Best Wishes, Peter Am 20.11.2014 um 16:54 schrieb Artyom Beilis: Add "-0" to curl option - to disable HTTP/1.1 Expect: 100 continue by switching to HTTP/1.0 Even big web servers by default do not enable it (lighttpd for example) and internal cppcms web server is simple HTTP/1.0 web server. What happens is that curl does not send the data... but rather waits... Artyom Beilis -------------- CppCMS - C++ Web Framework: http://cppcms.com/ CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/ From: Dr. Peter Gottschling <pet...@si...> To: Artyom Beilis <art...@ya...>; cpp...@li... Sent: Thursday, November 20, 2014 5:02 PM Subject: Re: [Cppcms-users] Idle time in handling post requests Thank you Artyom for you quick reply. The answers to your questions are below. I really appreciate your help. Best Regards, Peter Am 20.11.2014 um 15:02 schrieb Artyom Beilis: Hi, - What CppCMS version are you working with? 1.0.4 (#define CPPCMS_PACKAGE_STRING "CppCMS/1.0.4") - How do you POST the XML data: multipart/form-data or urlencoded? #!/bin/tcsh foreach f ( `ls xml-data/*.xml` ) curl -X POST http://localhost:8889 -Hcontent-type:application/xml -d @$f # cppcms end the files are copied from boost: cp `find .../boost_1_53_0 -name "*.xml" -size +8k -size -10k` ../curl/xml-data/ - Do you use an external web server or internal cppcms web server? localhost, see also config - Can you show the full code/configuration? Sure. Attached. I tried a synchronous and an asynchronous request handler but the performance was the same. Measuring the "client user time" is useless you need to see what happens on the server side. Now that you mention that... Never mind. Small notes: - since 1.0.5 there was a significant fix in upload times of multipart/form-data but what you show (10 s) it does not look like the case Well, then I will try a newer version. Just in case. - When uploading files starting from some size the files go to disk rather than to the memory: http://cppcms.com/wikipp/en/page/cppcms_1x_config#security.file_in_memory_limit However the default limit is around 128k... so does not look like your case. Artyom Beilis -------------- CppCMS - C++ Web Framework: http://cppcms.com/ CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/ From: Dr. Peter Gottschling <pet...@si...> To: CppCMS mailing list <cpp...@li...> Sent: Thursday, November 20, 2014 3:13 PM Subject: [Cppcms-users] Idle time in handling post requests Hi, We are using a CppCMS server and its performance is very low for post requests when the post messages reach a certain size of some kB. This already happens with minimal server examples from the beginners tutorial. The weird thing is that the server spends only 6 milliseconds in the main function (in total) but one or two seconds between two calls. - What is CppCMS doing in this time? - And more importantly, how can this time be shortened? - Is it an issue of the thread pool? - Is there some expensive treatment for the post messages? (I read something about compression) Can it be turned off or accelerated? Post requests with small data did not show these idle phases. 9 post requests with XML files between 8 and 10kB took 10 seconds wall clock time without even treating the requests. The user time was only 45ms. The same post requests take less than half a second with a similarly minimalistic node.js server. I tried different configurations and read a lot of dox and posts put couldn't find something that explains these long idle times. Any help is welcome. I can send the code and the configurations if this helps. Thank you in advance, Peter --- curl> time post_xml_files.sh Hello from CppCMS after 0.000135s Hello from CppCMS after 0.00111s Hello from CppCMS after 0.001995s Hello from CppCMS after 0.002756s Hello from CppCMS after 0.00354s Hello from CppCMS after 0.004228s Hello from CppCMS after 0.004865s Hello from CppCMS after 0.005481s Hello from CppCMS after 0.006174s real 0m10.154s user 0m0.046s sys 0m0.064s ------------------------------------------------------------------------------ Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server from Actuate! Instantly Supercharge Your Business Reports and Dashboards with Interactivity, Sharing, Native Excel Exports, App Integration & more Get technology previously reserved for billion-dollar corporations, FREE http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk _______________________________________________ Cppcms-users mailing list Cpp...@li... https://lists.sourceforge.net/lists/listinfo/cppcms-users ------------------------------------------------------------------------------ Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server from Actuate! Instantly Supercharge Your Business Reports and Dashboards with Interactivity, Sharing, Native Excel Exports, App Integration & more Get technology previously reserved for billion-dollar corporations, FREE http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk _______________________________________________ Cppcms-users mailing list Cpp...@li... https://lists.sourceforge.net/lists/listinfo/cppcms-users ------------------------------------------------------------------------------ Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server from Actuate! Instantly Supercharge Your Business Reports and Dashboards with Interactivity, Sharing, Native Excel Exports, App Integration & more Get technology previously reserved for billion-dollar corporations, FREE http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk _______________________________________________ Cppcms-users mailing list Cpp...@li... https://lists.sourceforge.net/lists/listinfo/cppcms-users ------------------------------------------------------------------------------ Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server from Actuate! Instantly Supercharge Your Business Reports and Dashboards with Interactivity, Sharing, Native Excel Exports, App Integration & more Get technology previously reserved for billion-dollar corporations, FREE http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk _______________________________________________ Cppcms-users mailing list Cpp...@li... https://lists.sourceforge.net/lists/listinfo/cppcms-users |