[pion-users] How to increase the the "concurrent processing threads" in pion - Handle leak
client and server HTTP(S) library for Boost C++ developers
Brought to you by:
mikedickey
From: Rohan S. <she...@ya...> - 2015-01-09 05:31:06
|
Hi, I use the following code, which is working fine pion::http::server_ptr m_HttpServer;unsigned int m_iPort = 0 //Listen only in the loopback interfaceboost::asio::ip::address addr(boost::asio::ip::address_v4::loopback()); // If port =0, then the HttpServer would take a free available portboost::asio::ip::tcp::endpoint endpoint(addr, m_iPort); // Create a web server and specify the port on which it will listen. m_HttpServer = pion::http::server_ptr(new pion::http::server(endpoint)); m_HttpServer->start(); Following is the handler used for testing this. void CPalHttpServer::RequestHandlerForPalRoot(const request_ptr & PtrHttpRequest, connection_ptr & PtrTcpConn){ string HELLO_HTML = "<html><body>PAL Service!</body></html>"; response_writer_ptr writer(response_writer::create(PtrTcpConn, * PtrHttpRequest, boost::bind(&connection::finish, PtrTcpConn))); writer->write(HELLO_HTML); writer->send()} By default PION supports around 8 threads, which will limit only 8 concurrent HTTP requests. I tried the following code, in which I have tried to increasing the thread to 100. Is this the right ? pion::http::server_ptr m_HttpServer;pion::single_service_scheduler m_DefaultScheduler;m_DefaultScheduler.set_num_threads(100);unsigned int m_iPort = 0 //Listen only in the loopback interfaceboost::asio::ip::address addr(boost::asio::ip::address_v4::loopback()); // If port =0, then the HttpServer would take a free available portboost::asio::ip::tcp::endpoint endpoint(addr, m_iPort); // Create a web server and specify the port on which it will listen. m_HttpServer = pion::http::server_ptr(new pion::http::server(m_DefaultScheduler, endpoint)); m_HttpServer->start(); Problem: There is couple of handle leaks for every http request processing.i.e when client sends the http request, I could see couple of handle leaks. Any help is appreciated Regards,Rohan |