3

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 for the beginners tutorial, slightly modified:

#include <cppcms/application.h>  
#include <cppcms/applications_pool.h>  
#include <cppcms/service.h>  
#include <cppcms/http_request.h>  
#include <cppcms/http_response.h>  
#include <cppcms/mount_point.h>  
#include <booster/intrusive_ptr.h>

#include <utility>
#include <iostream>  
#include <boost/timer.hpp>

class hello 
  : public cppcms::application 
{  
  public:  
    hello(cppcms::service &srv) :  
      cppcms::application(srv), counter(0) {}  
    virtual void main(std::string url);  
    boost::timer my_timer;
    int counter;
};

void hello::main(std::string url)  
{  
    response().out() << "Hello from asynchron CppCMS after " << my_timer.elapsed() << "s\n";
    std::cout << "[" << url.size() << "] = " << url.substr(0, 50) << '\n';
} 

int main(int argc,char ** argv)  
{  
    try {  
        cppcms::service srv(argc,argv); 
    booster::intrusive_ptr<hello> p= new hello(srv);
    srv.applications_pool().mount( p, cppcms::mount_point("(.*)") ); 
    srv.run();  
    }  
    catch(std::exception const &e) {  
    std::cerr << e.what() << std::endl;  
    } 
    return 0;
}    

The weird thing is that the server spends only some milliseconds in the main function but one or two seconds between two calls.

  1. What is CppCMS doing in this time?
  2. And more importantly, how can this time be shortened?
  3. Is it an issue of the thread pool?
  4. Is there some expensive treatment of the post messages? (I read something about compression) Can it be turned off or accelerated?

9 post requests with XML files between 8 and 10kB takes 9s seconds without even treating the requests. The same requests take less than half a second with a 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.

Thank you in advance, Peter

0 Answers0