473,412 Members | 2,088 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,412 software developers and data experts.

XMLRPC Server

Hi, I'm trying to create an XMLRPC server using apache + python (cgi).
It's not too difficult to configure everything, but I would like to
tune it in order to receive up to 2000 calls per minute without any
problems. Do Pthon CGIs use threading?
I need to make it very efficient, but I haven't found much information
about Python CGI optimization.
The called function will update a table in a mysql db. I will use
triggers to export data from the table updated by the xmlrpc server to
other tables used by the backend application.

any hint?

lv

Feb 6 '07 #1
7 2169
vi******@gmail.com wrote:
Hi, I'm trying to create an XMLRPC server using apache + python (cgi).
It's not too difficult to configure everything, but I would like to
tune it in order to receive up to 2000 calls per minute without any
problems. Do Pthon CGIs use threading?
I need to make it very efficient, but I haven't found much information
about Python CGI optimization.
The called function will update a table in a mysql db. I will use
triggers to export data from the table updated by the xmlrpc server to
other tables used by the backend application.
You might consider using the twisted application server framework instead,
and totally ditch the CGI, and even the apache.

http://twistedmatrix.com/

http://twistedmatrix.com/projects/we...ples/xmlrpc.py

Diez
Feb 6 '07 #2
Unfortunately I have to use Apache. The server implementation will we
very easy, so I'm also considering more efficient solutions than
python

lv

On Feb 6, 11:36 am, "Diez B. Roggisch" <d...@nospam.web.dewrote:
visca...@gmail.com wrote:
Hi, I'm trying to create an XMLRPC server using apache + python (cgi).
It's not too difficult to configure everything, but I would like to
tune it in order to receive up to 2000 calls per minute without any
problems. Do Pthon CGIs use threading?
I need to make it very efficient, but I haven't found much information
about Python CGI optimization.
The called function will update a table in a mysql db. I will use
triggers to export data from the table updated by the xmlrpc server to
other tables used by the backend application.

You might consider using the twisted application server framework instead,
and totally ditch the CGI, and even the apache.

http://twistedmatrix.com/

http://twistedmatrix.com/projects/we...ples/xmlrpc.py

Diez

Feb 6 '07 #3
Unfortunately I have to use Apache. The server implementation will be
very easy, so I'm also considering more efficient solutions than
python

lv

On Feb 6, 11:36 am, "Diez B. Roggisch" <d...@nospam.web.dewrote:
visca...@gmail.com wrote:
Hi, I'm trying to create an XMLRPC server using apache + python (cgi).
It's not too difficult to configure everything, but I would like to
tune it in order to receive up to 2000 calls per minute without any
problems. Do Pthon CGIs use threading?
I need to make it very efficient, but I haven't found much information
about Python CGI optimization.
The called function will update a table in a mysql db. I will use
triggers to export data from the table updated by the xmlrpc server to
other tables used by the backend application.

You might consider using the twisted application server framework instead,
and totally ditch the CGI, and even the apache.

http://twistedmatrix.com/

http://twistedmatrix.com/projects/we...ples/xmlrpc.py

Diez

Feb 6 '07 #4
vi******@gmail.com wrote:
Hi, I'm trying to create an XMLRPC server using apache + python (cgi).
It's not too difficult to configure everything, but I would like to
tune it in order to receive up to 2000 calls per minute without any
problems.
That doesn't seem like excessive volume. Why not just try it? You could
replace your database logic with time.sleep(1) for now.
Do Pthon CGIs use threading?
To do what? CGI requires that a new interpreter instance be launched to
handle every request. The requests will be handled in parallel with the
number of requests handled simultaneously depending on your apache
configuration.
I need to make it very efficient,
Actually, you might not have to. 2000 calls/minute isn't that big,
assuming you have a decent server.

Cheers,
Brian
Feb 6 '07 #5
On 6 Feb, 12:30, "Lorenzo" <lorenzo.visca...@gmail.comwrote:
Unfortunately I have to use Apache. The server implementation will we
very easy, so I'm also considering more efficient solutions than
python
You could try mod_python if there isn't an absolute requirement for
CGI:

http://www.modpython.org/

Some people might recommend other frameworks which operate in separate
long-running processes, but if you don't have the freedom to have such
processes, you might wish to consider focusing on the start-up costs
of your CGI programs. Once upon a time, CGI was deemed very expensive
because process creation was itself expensive, and many database-
related CGI programs had to open connections to database systems whose
connection costs were very expensive (eg. Oracle). While not spawning
new processes and not opening and closing database connections avoids
such costs, it is worth reviewing just how expensive such things are
on modern operating systems (on modern hardware) and with other
database systems (such as MySQL, which you said you were using).
Ultimately, some benchmarking/profiling will indicate whether your
performance expectations are realistic.

Paul

Feb 6 '07 #6
Brian Quinlan wrote:
Actually, you might not have to. 2000 calls/minute isn't that big,
assuming you have a decent server.
well, if you're talking pure CGI, you need to start the interpreter,
import the required modules, connect to the database, unmarshal the
xml-rpc request, talk to the database, marshal the response, and shut
down, in less than 30 milliseconds.

just importing the CGI module (or the database module) can take longer
than that...

</F>

Feb 6 '07 #7
Fredrik Lundh wrote:
well, if you're talking pure CGI, you need to start the interpreter,
import the required modules, connect to the database, unmarshal the
xml-rpc request, talk to the database, marshal the response, and shut
down, in less than 30 milliseconds.

just importing the CGI module (or the database module) can take longer
than that...
The original performance specification was "...receive up to 2000 calls
per minute". I don't believe that means that a call has to be serviced
in under 30ms (wall-clock time) but total CPU time would have to be
<30ms in order to not fall behind under a constant 2000 requests/second
load. So we can probably remove database connection and communication
time (i.e. IO-bound components). Still, it's a lot tighter than I though
it would be:

% time python -c "import SimpleXMLRPCServer; import MySQLdb"

real 0m0.144s
user 0m0.046s
sys 0m0.064s

So it's already almost 4x too slow. But I'm running this on Ubuntu,
running on VMWare on my 1.6GHz Pentium-M laptop. I would assume that a
beefy server would do a lot better.

Cheers,
Brian
Feb 6 '07 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: glin | last post by:
Hi I am trying to integrate the xmlrpc server into a class, does anyone know how to get it working? test.html: <html> <head> <title>XMLRPC Test</title> <script src="jsolait/init.js"></script>...
0
by: Juan Carlos CORUÑA | last post by:
Hello all, I'm trying to create a COM Server with an embedded xmlrpc server. Here is way it must work: - The client application (programmed with a COM capable language) instantiates my COM...
1
by: Joxean Koret | last post by:
Hi to all! I'm having troubles to make my XMLRPC application working with non ASCII characters. Example: 1.- In one terminal run the following script: -----------XMLRPC...
1
by: emielvl | last post by:
Hello, I'm developing a client/server architecture based on the XML-RPC implementation in php4. All works pretty well, except that in the response from the server there is no "Content-Length" in...
3
by: David Hirschfield | last post by:
An xmlrpc client/server app I'm writing used to be super-simple, but now threading has gotten into the mix. On the server side, threads are used to process requests from a queue as they come in....
1
by: fortepianissimo | last post by:
I have a simple xmlrpc server/client written in Python, and the client throws a list of lists to the server and gets back a list of lists. This runs without a problem. I then wrote a simple Java...
6
by: half.italian | last post by:
Hi, I'm trying to serve up a simple XMLRPC server as a windows service. I got it to run properly, I'm just not sure how to stop it properly. Most of the documentation/examples I found for this...
1
by: Sean Davis | last post by:
I would like to set up a server that takes XMLRPC requests and processes them asynchronously. The XMLRPC server part is trivial in python. The job processing part is the part that I am having...
0
by: Benjamin Grieshaber | last post by:
Hi, I´m on SuSE 9.3 with xmlrpc-c and xmlrpc-c-devel installed (ver. 0.9.10) I tried to compile php with xmlrpc support and got the following errors: ...
4
by: care02 | last post by:
I have implemented a simple Python XMLRPC server and need to call it from a C/C++ client. What is the simplest way to do this? I need to pass numerical arrays from C/C++ to Python. Yours, Carl
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.