Re: Recommendation for small, fast, Python based web server

2009-12-27 Thread python
 This is a new wsgi web server implemented in a single file.
 http://code.google.com/p/web2py/source/browse/gluon/sneaky.py

Thank you Massimo.

Regards,
Malcolm
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Recommendation for small, fast, Python based web server

2009-12-26 Thread Antoine Pitrou
Le Fri, 25 Dec 2009 10:38:19 -0800, Aahz a écrit :
 In article mailman.1720.1260539582.2873.python-l...@python.org,
 Antoine Pitrou  solip...@pitrou.net wrote:

Apparently you have debugged your speed issue so I suppose you don't
have performance problems anymore. Do note, however, that Python is
generally not as fast as C -- especially for low-level stuff -- and a
Python Web server will probably serve around 10x less requests per
second than a C Web server like Apache (this will still give you
hundreds of simple requests per second on a modern machine).
 
 For static pages or dynamic pages?  Once you get into dynamic pages, I
 sincerely doubt that the smaller Apache overhead makes lots of
 difference.

For static pages. Yes, I guess the difference for dynamic pages would 
indeed be quite small. Especially if database activity is also involved.

Regards

Antoine.


-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Recommendation for small, fast, Python based web server

2009-12-25 Thread Aahz
In article mailman.1720.1260539582.2873.python-l...@python.org,
Antoine Pitrou  solip...@pitrou.net wrote:

Apparently you have debugged your speed issue so I suppose you don't have 
performance problems anymore. Do note, however, that Python is generally 
not as fast as C -- especially for low-level stuff -- and a Python Web 
server will probably serve around 10x less requests per second than a C 
Web server like Apache (this will still give you hundreds of simple 
requests per second on a modern machine).

For static pages or dynamic pages?  Once you get into dynamic pages, I
sincerely doubt that the smaller Apache overhead makes lots of
difference.
-- 
Aahz (a...@pythoncraft.com)   * http://www.pythoncraft.com/

Looking back over the years, after I learned Python I realized that I
never really had enjoyed programming before.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Recommendation for small, fast, Python based web server

2009-12-25 Thread mdipierro
This is a new wsgi web server implemented in a single file.

http://code.google.com/p/web2py/source/browse/gluon/sneaky.py

I could use some help with testing.

Here is a version for Python 3.0

http://code.google.com/p/web2py/source/browse/gluon/sneaky.py


Massimo

On Dec 25, 12:38 pm, a...@pythoncraft.com (Aahz) wrote:
 In article mailman.1720.1260539582.2873.python-l...@python.org,
 Antoine Pitrou  solip...@pitrou.net wrote:



 Apparently you have debugged your speed issue so I suppose you don't have
 performance problems anymore. Do note, however, that Python is generally
 not as fast as C -- especially for low-level stuff -- and a Python Web
 server will probably serve around 10x less requests per second than a C
 Web server like Apache (this will still give you hundreds of simple
 requests per second on a modern machine).

 For static pages or dynamic pages?  Once you get into dynamic pages, I
 sincerely doubt that the smaller Apache overhead makes lots of
 difference.
 --
 Aahz (a...@pythoncraft.com)           *        http://www.pythoncraft.com/

 Looking back over the years, after I learned Python I realized that I
 never really had enjoyed programming before.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Recommendation for small, fast, Python based web server

2009-12-11 Thread Antoine Pitrou

Hello,

 I've looked at the web servers that come bundled with the Python
 standard library[1] and they are too slow.

Apparently you have debugged your speed issue so I suppose you don't have 
performance problems anymore. Do note, however, that Python is generally 
not as fast as C -- especially for low-level stuff -- and a Python Web 
server will probably serve around 10x less requests per second than a C 
Web server like Apache (this will still give you hundreds of simple 
requests per second on a modern machine).

In any case, as far as functionality, robustness, portability and 
community support are concerned, you probably can't go wrong with Twisted.

Regards

Antoine.


-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Recommendation for small, fast, Python based web server

2009-12-11 Thread Irmen de Jong

On 11-12-2009 14:52, Antoine Pitrou wrote:


Hello,


I've looked at the web servers that come bundled with the Python
standard library[1] and they are too slow.


Apparently you have debugged your speed issue so I suppose you don't have
performance problems anymore. Do note, however, that Python is generally
not as fast as C -- especially for low-level stuff -- and a Python Web
server will probably serve around 10x less requests per second than a C
Web server like Apache (this will still give you hundreds of simple
requests per second on a modern machine).


I don't think that number is fair for Python. I think a well written 
Python web server can perform in the same ballpark as most mainstream 
web servers written in C. Especially Apache, which really isn't a top 
performer. And I'm pretty sure a well written Python server can 
outperform a badly written C based server easily.


-irmen
--
http://mail.python.org/mailman/listinfo/python-list


Re: Recommendation for small, fast, Python based web server

2009-12-11 Thread Antoine Pitrou
Le Fri, 11 Dec 2009 19:40:21 +0100, Irmen de Jong a écrit :
 
 I don't think that number is fair for Python. I think a well written
 Python web server can perform in the same ballpark as most mainstream
 web servers written in C. Especially Apache, which really isn't a top
 performer. And I'm pretty sure a well written Python server can
 outperform a badly written C based server easily.

The order of magnitude I gave is based on real-world testing. You are 
under-estimating how much of an impact Python's interpretation speed has 
on low-level code. Even Apache *is* a top performer compared to Python 
web servers.


-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Recommendation for small, fast, Python based web server

2009-12-09 Thread Tim Chase

pyt...@bdurham.com wrote:

I'm looking for a small, simple, fast, Python based web server
for a simple, client side application we're building. 


I've used WebStack[1] for this in the past.  It allows for 
stand-alone serving as well as plugging nicely into various 
real servers (apache+mod_python, etc) with a small tweak in how 
it's configured.



I've looked at the web servers that come bundled with the Python
standard library[1] and they are too slow. I suspect this is
because they don't maintain a session between the client and
server, thus every GET/POST request repeats the session setup and
break down process. Or they might be based on a polling model?


I'm not sure what caused the slowness you've experienced -- using 
Python in a CGI environment requires starting the Python 
interpreter each time.  However if the interpreter starts just 
once, I've not had notable performance issues for low-volume 
sites (using the BaseHTTP builtin).  For higher-volume sites, you 
might reach for Twisted which WebStack supports as well.  I 
believe both WebStack and Twisted are redistribtable as needed.


-tkc

[1] http://www.boddie.org.uk/python/WebStack.html




--
http://mail.python.org/mailman/listinfo/python-list


Re: Recommendation for small, fast, Python based web server

2009-12-09 Thread Daniel Fetchinson
 I'm looking for a small, simple, fast, Python based web server
 for a simple, client side application we're building. We don't
 want to distrubute and support a real web server like Apache or
 Tomcat or depend on the presence of local web server such as IIS.
 The application in question will service AJAX requests from a
 browser.

 We're not looking for a web framework like Django, Plone, etc.

 I've looked at the web servers that come bundled with the Python
 standard library[1] and they are too slow. I suspect this is
 because they don't maintain a session between the client and
 server, thus every GET/POST request repeats the session setup and
 break down process. Or they might be based on a polling model?

 Here are the other Python based web server implementations I'm
 aware of:
 - cherrypy
 - web.py
 - twisted

 Any recommendations appreciated (Python 2.6 preferred but open to
 Python 3.1 options).

I'm using cherrypy for this purpose, actually together with turbogears 1.

Cheers,
Daniel


-- 
Psss, psss, put it down! - http://www.cafepress.com/putitdown
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Recommendation for small, fast, Python based web server

2009-12-09 Thread python
Tim,

 I've used WebStack[1] for this in the past. It allows for stand-alone serving 
 as well as plugging nicely into various real servers (apache+mod_python, 
 etc) with a small tweak in how it's configured.

Thanks for that recommendation.

 I'm not sure what caused the slowness you've experienced (... with running 
 local versions of Python web servers)

Thanks to a past post by Christoph Zwerschke c...@online.de, I was
able to identify the problem.

Windows (XP, Vista, Windows 7) tries to do a IPV6 connection which times
out after a second followed by an IPV4 connection which is almost
instantaneous. Apparently this is a known problem that is a Windows
issue [1] - not a Python problem.

Two workarounds:

1. Use 127.0.0.1 as your URL vs. localhost 

-OR-

2. Edit your Windows hosts file (c:\windows\system32\drivers\etc\hosts)
and create a virtual domain name, eg. put the following on a line by
itself:

127.0.0.1  mydomain.someext

And then use mydomain.someext vs. localhost

Note: Editing your hosts file requires admin rights under Vista and
Windows 7.

Regards,
Malcolm

[1]
http://schotime.net/blog/index.php/2008/05/27/slow-tcpclient-connection-sockets/
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Recommendation for small, fast, Python based web server

2009-12-09 Thread python
Daniel,

 I'm using cherrypy for this purpose, actually together with turbogears 1.

My research has constantly pointed back to cherrypy as a tool of choice
for building local web servers. My initial impression was that cherrypy
was too big and complicated for my simple task. However, I'm going to
re-examine this assumption and take another look at cherrypy.

Thanks for your help!

Regards,
Malcolm
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Recommendation for small, fast, Python based web server

2009-12-09 Thread birdsong
On Dec 9, 4:05 pm, pyt...@bdurham.com wrote:
 Daniel,

  I'm using cherrypy for this purpose, actually together with turbogears 1.

 My research has constantly pointed back to cherrypy as a tool of choice
 for building local web servers. My initial impression was that cherrypy
 was too big and complicated for my simple task. However, I'm going to
 re-examine this assumption and take another look at cherrypy.

 Thanks for your help!

 Regards,
 Malcolm

tornado all the way, it is teh radness: http://www.tornadoweb.org/

epoll based python server.  fun to hack on. def check it out.
-- 
http://mail.python.org/mailman/listinfo/python-list