|
|

12-06-2006, 04:42 PM
|
|
New Member
|
|
Join Date: Sep 2006
Posts: 3
|
|
LSWS and Django
Anyone tried using the python-based Django web framework under Litespeed?
More info at http://www.djangoproject.com/
It's got built-in FCGI support with flup (http://trac.saddi.com/flup), and I've had minimal success running it in threaded mode, and no success running it in prefork mode. When in threaded mode, it serves up pages for a while then returns 503s until I restart the process. Prefork starts up all the processes and then just returns 503s all the time.
On the Django site, they mention that their preferred method of serving is to run apache with mod_python, but I have a feeling Litespeed can outperform it if I can get it running correctly.
Any help is appreciated.
|

12-06-2006, 05:00 PM
|
|
LiteSpeed Staff
|
|
Join Date: Oct 2003
Location: Los Angeles, California
Posts: 380
|
|
|
tpersen,
Not all FCGI frameworks are created equal.
Try this:
1) Disable "persistent connection" under FCGI extapp.
2) From trac.saddi.com/flup it looks like they support AJP 1.3 interface in-addition to FCGi. Instead of using a FCGI extapp, use a Java/AJP extapp instead.
|

12-07-2006, 11:37 PM
|
|
New Member
|
|
Join Date: Sep 2006
Posts: 3
|
|
|
The "persistent connection" setting was already set to N/A. I tried setting it to "no", but it didn't make a difference.
It seems that threaded mode is working alright. I think the reason it fails eventually has to do with the process running in debug mode. I haven't tried disabling debug yet, but I think that's where the problem lies.
In prefork mode, however, I am still not getting anything except 503s. I see all the python processes spawn, the socket is created, but they don't seem to be communicating with litespeed. Any other ideas?
Also, I've only tried on my development machine, which is an iMac. I'll try it on one of my linux servers tomorrow and see if I get any different results. Another alternative is that I could try rewriting their fcgi script to use the libraries you recommended instead if nothing else seems to work.
Todd
|

12-16-2006, 09:19 AM
|
|
Senior Member
|
|
Join Date: Aug 2006
Posts: 57
|
|
Any luck?
What were your results? I have been meaning to try Django for some time but the whole install and deployment seem to be a drag. Any luck getting it to run succesfully? Any tips? I'd love to give it a try under LS.
Thanks in advance,
AEM
Quote:
Originally Posted by tpersen
The "persistent connection" setting was already set to N/A. I tried setting it to "no", but it didn't make a difference.
It seems that threaded mode is working alright. I think the reason it fails eventually has to do with the process running in debug mode. I haven't tried disabling debug yet, but I think that's where the problem lies.
In prefork mode, however, I am still not getting anything except 503s. I see all the python processes spawn, the socket is created, but they don't seem to be communicating with litespeed. Any other ideas?
Also, I've only tried on my development machine, which is an iMac. I'll try it on one of my linux servers tomorrow and see if I get any different results. Another alternative is that I could try rewriting their fcgi script to use the libraries you recommended instead if nothing else seems to work.
Todd
|
|

12-16-2006, 12:00 PM
|
|
LiteSpeed Staff
|
|
Join Date: May 2003
Location: New Jersey
Posts: 7,590
|
|
|
Took a brief look at Django document and flup code, I think it should work well with LSWS. Just a little tricky for the FCGI startup command.
If you want LSWS to manage the FCGI instances, you can try:
MaxConn: 20 (<50 is OK, flup support upto 50 connections by default)
Auto Start: true
Command: path_to_manage.py runfcgi daemonize=false (method could be threaded or prefork)
Intance: 1
Make sure you do NOT specify host, port or socket command line option in LSWS managed mode. LSWS will create those sockets.
If you want to start it manually, just set "Auto Start" to false and the follow Django document.
|

12-16-2006, 04:39 PM
|
|
Senior Member
|
|
Join Date: Aug 2006
Posts: 57
|
|
Thanks for the info. I'm always pleasantly surprised by the support in this forum. I gave it a try locally and it looked interesting but I don't think I will be using it in production anytime soon.
Thanks again,
Adrian Madrid
Quote:
Originally Posted by mistwang
Took a brief look at Django document and flup code, I think it should work well with LSWS. Just a little tricky for the FCGI startup command.
If you want LSWS to manage the FCGI instances, you can try:
MaxConn: 20 (<50 is OK, flup support upto 50 connections by default)
Auto Start: true
Command: path_to_manage.py runfcgi daemonize=false (method could be threaded or prefork)
Intance: 1
Make sure you do NOT specify host, port or socket command line option in LSWS managed mode. LSWS will create those sockets.
If you want to start it manually, just set "Auto Start" to false and the follow Django document.
|
|

07-27-2007, 03:39 AM
|
|
New Member
|
|
Join Date: Nov 2006
Posts: 1
|
|
one working setup
If anyone stumble upon this thread.
I have a working setup using the AJP connector.
Initially I used it in threading mode, but I think the session support in django doesn't like that, so I had to switch to forked. The performance hit isn't terrible, but it's still annoying.
|

07-27-2007, 08:30 AM
|
|
LiteSpeed Staff
|
|
Join Date: May 2003
Location: New Jersey
Posts: 7,590
|
|
|
How does it compare with other python API interface written in pure python, performance wise?
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -7. The time now is 02:59 AM.
|
|