is there a multi-threaded server.py

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

is there a multi-threaded server.py

Blank User
with hello world example on the website it appear only one client can
connect at a time.
instead of just returning the string back to the client, when i add
time.sleep(10) before returning it seems to stall all client.

0 second - launch 1 copy of server.py and 2 copies of firefox
1 second - client A makes request
2 second - client B makes request
11 second - client A receives response as it should
12 second - client B receives no response (this is my desired outcome)
21 second - client B finally receives the response (10 seconds after
client A made a request not 10 seconds after B made request)

is there a multi-threaded version of this server.py so that client B
gets a response at second 12 instead of 21?

in my case, the wait is only about 100 millisecond but that means only
10 clients can connect per second which is far to little for what my
boss needs.
_______________________________________________
PyAMF users mailing list - [hidden email]
http://lists.pyamf.org/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: is there a multi-threaded server.py

David Wolever-4
This is to be expected — by default, the pyamf examples use a simple  
single-threaded server.

To run PyAMF in production, you should run it behind a "real" server  
(probably using WSGI), which will take care of threading/forking for  
you.

I, personally, like Apache + mod_wsgi… And there are tons of  
instructions online (Django instructions should be fine to follow —  
just ignore the django-specific bits).

On 2-Aug-10, at 1:33 PM, Blank User wrote:

> with hello world example on the website it appear only one client can
> connect at a time.
> instead of just returning the string back to the client, when i add
> time.sleep(10) before returning it seems to stall all client.
>
> 0 second - launch 1 copy of server.py and 2 copies of firefox
> 1 second - client A makes request
> 2 second - client B makes request
> 11 second - client A receives response as it should
> 12 second - client B receives no response (this is my desired outcome)
> 21 second - client B finally receives the response (10 seconds after
> client A made a request not 10 seconds after B made request)
>
> is there a multi-threaded version of this server.py so that client B
> gets a response at second 12 instead of 21?
>
> in my case, the wait is only about 100 millisecond but that means only
> 10 clients can connect per second which is far to little for what my
> boss needs.
> _______________________________________________
> PyAMF users mailing list - [hidden email]
> http://lists.pyamf.org/mailman/listinfo/users
>

_______________________________________________
PyAMF users mailing list - [hidden email]
http://lists.pyamf.org/mailman/listinfo/users