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 7 2197 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
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.we b.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
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.we b.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
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
On 6 Feb, 12:30, "Lorenzo" <lorenzo.visca. ..@gmail.comwro te:
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
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>
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 SimpleXMLRPCSer ver; 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 This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
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>
<script src="jsolait/lib/urllib.js"></script>
<script src="jsolait/lib/xml.js"></script>
|
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 server (programmed with python).
- The COM server must have a connect interface in order to let the
client application process the xmlrpc request.
- After executing a "serveforever" method on the COM server it begins
|
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 Server-------------
|
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 the header.
Since the XML-RPC specification requires this header to be present in
the server response, some libraries (notably: libxmlrpc++) choke on
this. For clarity, here's a (simple) server (slightly altered from:...
|
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.
On the client side, threads are used to wait on the results of requests
to the server.
So the question is: how thread-safe is python xmlrpc? If the client
makes a request of the server by calling:
| |
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 xmlrpc client and it calls the python
server. But I can't figure out what type to cast the result (of type
Object) to. The Java xmlrpc call is basically this:
Object result = client.execute("MyFunction", params);
|
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 was from forums,
so I'd love some links to relevant info also. Here's what I
have...taken from the cookbook with the xmlrpc server added:
import win32serviceutil
import win32service
|
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 trouble
with. I have been looking at how to use threadpool, but I can't see
how to get that working. I would like to have the XMLRPC part of
things do something like:
def method1(a,b,c):
jobid=workRequest(long_method1,)
return(jobid)
|
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:
ext/xmlrpc/.libs/xmlrpc-epi-php.o(.text+0x359): In function
`set_zval_xmlrpc_type':
/php-5.2.5/ext/xmlrpc/xmlrpc-epi-php.c:1313: undefined reference to
`XMLRPC_CreateValueDateTime_ISO8601'
|
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
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
| |
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |