Thread: [Jsonrpc-cpp-devel] Multithreaded server
Brought to you by:
s-vincent
From: Ditwin N. <pei...@gm...> - 2012-02-11 20:33:49
|
Hi all ! I'm developping a TCP server with JSON RPC C++. I really need a multithreaded server to deploy it on a webservice having a .. .respectable traffic. Does anyone have already created a multithreaded version ? Could anyone help to do it ? Thanks in advance ! M. Salles PS: Write in English or French |
From: Sebastien V. <seb...@cp...> - 2012-02-12 15:51:42
Attachments:
smime.p7s
|
Hi, This is on the TODO list but unfortunately I have not enough free time to make design and implementation. You can begin work on it. But it will be great to discuss design/implementation on this mailing-list. FYI, there are some classes to deals with thread in a portable manner in system.cpp. Best regards, -- Seb Le 11/02/2012 21:33, Ditwin Normandie a écrit : > Hi all ! > > I'm developping a TCP server with JSON RPC C++. > > I really need a multithreaded server to deploy it on a webservice > having a .. .respectable traffic. > > Does anyone have already created a multithreaded version ? Could > anyone help to do it ? > > Thanks in advance ! > > M. Salles > PS: Write in English or French > > > ------------------------------------------------------------------------------ > Virtualization& Cloud Management Using Capacity Planning > Cloud computing makes use of virtualization - but cloud computing > also focuses on allowing computing to be delivered as a service. > http://www.accelacomm.com/jaw/sfnl/114/51521223/ > > > _______________________________________________ > Jsonrpc-cpp-devel mailing list > Jso...@li... > https://lists.sourceforge.net/lists/listinfo/jsonrpc-cpp-devel |
From: Sebastien V. <seb...@cp...> - 2012-02-13 08:26:50
Attachments:
smime.p7s
|
Hi, Please keep the discussion on the mailing-list (I cc it) as other users might be interrested to multithreaded JSON-RPC server implementation. More inline. Le 12/02/2012 17:51, PEI Normandie a écrit : > Ok, > > I saw some Thread objects in Server class but no real implementation > in TCPServer class. > Yes I have just created the Thread/Mutex abstraction class but the *Server class do not use them for the moment. > I am not really a specialist of network programming. I'm learning ... > even if I have some experience in general programming. > > I tried to adapt your code to make it multithreaded ... But memory > corruption occured. > > I have problems to make it work. I will have to make it secured AND > robust for a website using it, which have more than 300 000 visitors a > month. > > I try to submit you some code as soon as possible. > OK. Please also explain your design (one thread for recv() ? how many thread for processing ? ...). We should also think about making the UDP server multithreaded too. Regards, -- Seb > > Médéric > > Je viens de voir que je réponds à ton adresse perso, donc on pourra > continuer en Français si tu veux :) > > > > On 12 February 2012 15:35, Sebastien Vincent > <seb...@cp... > <mailto:seb...@cp...>> wrote: > > Hi, > > This is on the TODO list but unfortunately I have not enough free > time to make design and implementation. > > You can begin work on it. But it will be great to discuss > design/implementation on this mailing-list. > > FYI, there are some classes to deals with thread in a portable > manner in system.cpp. > > Best regards, > -- > Seb > > Le 11/02/2012 21:33, Ditwin Normandie a écrit : >> Hi all ! >> >> I'm developping a TCP server with JSON RPC C++. >> >> I really need a multithreaded server to deploy it on a webservice >> having a .. .respectable traffic. >> >> Does anyone have already created a multithreaded version ? Could >> anyone help to do it ? >> >> Thanks in advance ! >> >> M. Salles >> PS: Write in English or French >> ------------------------------------------------------------------------------ >> Virtualization& Cloud Management Using Capacity Planning >> Cloud computing makes use of virtualization - but cloud computing >> also focuses on allowing computing to be delivered as a service. >> http://www.accelacomm.com/jaw/sfnl/114/51521223/ >> _______________________________________________ >> Jsonrpc-cpp-devel mailing list >> Jso...@li... <mailto:Jso...@li...> >> https://lists.sourceforge.net/lists/listinfo/jsonrpc-cpp-devel > > > ------------------------------------------------------------------------------ > Virtualization & Cloud Management Using Capacity Planning > Cloud computing makes use of virtualization - but cloud computing > also focuses on allowing computing to be delivered as a service. > http://www.accelacomm.com/jaw/sfnl/114/51521223/ > _______________________________________________ > Jsonrpc-cpp-devel mailing list > Jso...@li... > <mailto:Jso...@li...> > https://lists.sourceforge.net/lists/listinfo/jsonrpc-cpp-devel > > > > > -- > Cordialement, > > M. Salles > Ditwin.fr > Réseau social professionnel pour la recherche d'emploi et le recrutement > http://www.ditwin.fr > Mel: co...@di... <mailto:co...@di...> |
From: PEI N. <pei...@gm...> - 2012-02-15 00:26:08
|
My program uses only one thread for treatments. I think Recv should create his own thread. The "select" function allows some concurrent connections. But when the connections are about hundreds the server is dead, takes all memory and sleeps ... So, make the Recv function to create his own thread, run it and closes the socket. Why should we use a Mutex ? I hope the server's methods can be used concurrently. If it can't, does that mean that multithreaded server is useless ? |
From: Sebastien V. <seb...@cp...> - 2012-02-15 07:55:14
|
Hi, Le 15/02/2012 01:26, PEI Normandie a écrit : > > My program uses only one thread for treatments. I think Recv should > create his own thread. > > The "select" function allows some concurrent connections. But when the > connections are about hundreds the server is dead, takes all memory > and sleeps ... > Just for information, d you have reports and statistics about that ? > So, make the Recv function to create his own thread, run it and closes > the socket. Do you mean, create one thread per new request ? > > Why should we use a Mutex ? I hope the server's methods can be used > concurrently. If it can't, does that mean that multithreaded server is > useless ? > The mutex is sometime necessary... it depends if you have objects you would like to share between threads. Regards, -- Seb |
From: Ditwin - C. <co...@di...> - 2012-02-15 11:38:54
|
Just for information, d you have reports and statistics about that ? > I have two implementations of my website. The first uses Symfony, the second is implemented in PHP, and uses a webservice written with JSON RPC CPP. I used Apache Benchmark (ab) to compare the two versions. The second version is really faster with about 100 calls. But with a more > > So, make the Recv function to create his own thread, run it and closes >> the socket. >> > > Do you mean, create one thread per new request ? Yes. But it could be possible to create a set of initial thread when the server starts ? This could be more effective this way, rather than creating one thread, process the method, destroy the thread ... Create a new new and so on. The mutex is sometime necessary... it depends if you have objects you would > like to share between threads. > Ok, I don't need to share objects between thread, because each method create his own objects depending on the requests. |
From: Sebastien V. <seb...@cp...> - 2012-02-15 15:05:15
Attachments:
smime.p7s
|
Hi, Le 15/02/2012 12:38, Ditwin - Contact a écrit : > > > Just for information, d you have reports and statistics about that ? > > > > I have two implementations of my website. The first uses Symfony, the > second is implemented in PHP, and uses a webservice written with JSON > RPC CPP. > > I used Apache Benchmark (ab) to compare the two versions. The second > version is really faster with about 100 calls. But with a more > OK. > > So, make the Recv function to create his own thread, run it > and closes the socket. > > > Do you mean, create one thread per new request ? > > > Yes. But it could be possible to create a set of initial thread when > the server starts ? This could be more effective this way, rather than > creating one thread, process the method, destroy the thread ... Create > a new new and so on. > > The right way would be to have a thread pool and a set of method to increase/decrease number of threads. > > The mutex is sometime necessary... it depends if you have objects > you would like to share between threads. > > > Ok, I don't need to share objects between thread, because each method > create his own objects depending on the requests. OK. Regards, -- Seb |