LiteSpeed Technologies
Download Download     Blog Blog     Wiki Wiki     Forum Forum     Store     Contact Contact    

Go Back   LiteSpeed Support Forums > LiteSpeed Web Server > Feedback/Feature Requests > php sapi ? ;)

Reply
 
Thread Tools Display Modes
  #1  
Old 03-18-2005, 03:07 AM
ts77 ts77 is offline
Senior Member
 
Join Date: Nov 2004
Posts: 288
Default php sapi ? ;)

hi there,

I've seen your post on the php-list about committing a sapi-module for connecting php with litespeed.
just curious ... what problems does this solve in comparison to fast-cgi?


thx,

thomas
Reply With Quote
  #2  
Old 03-18-2005, 08:57 AM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,590
Good question. :-)
It adds the ability to override configurations via .htaccess or virtual host configuration, just like Apache's mod_php. It is a major security concern to use PHP with Fast CGI SAPI under shared hosting environment.

And there are performance advantages over Fast CGI SAPI as well.
Reply With Quote
  #3  
Old 03-18-2005, 09:06 AM
ts77 ts77 is offline
Senior Member
 
Join Date: Nov 2004
Posts: 288
thanks for your reply.

how should it work then?
You talk about performance advantages but litespeed is a single-process webserver.
doesn't the php still need to run in multiple separate processes so that it will be running kind of like with fast-cgi?
Reply With Quote
  #4  
Old 03-18-2005, 09:14 AM
ts77 ts77 is offline
Senior Member
 
Join Date: Nov 2004
Posts: 288
eh, sorry you answered the architecture question on the php-list already.
(for the other ones interested -> http://news.php.net/php.internals/15488)

I'm still interested in backend-load-balancing on different machines (be it php via fast-cgi or your own sapi ).
Reply With Quote
  #5  
Old 03-18-2005, 09:17 AM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,590
Yes, it works in similiar way as Fast CGI SAPI.
Cannot call any code that causes blocking inside a non-blocking event driven application.
And I don't want to run PHP in another thread, as PHP is not very thread friendly and I don't want the whole server crash with PHP. ;-)
Reply With Quote
  #6  
Old 05-27-2005, 02:07 PM
ts77 ts77 is offline
Senior Member
 
Join Date: Nov 2004
Posts: 288
sorry to bring up that old thread again ... but its related.
On page http://www.litespeedtech.com/docs/HowTo_QA.html#qa_php there is a note
Quote:
There is one environment variable can be used to customize PHP LiteSpeed application. PHP_LSAPI_MAX_REQUESTS=XXXX controls how many requests each child process will handle before exit. It protects against memory leak inside PHP. Default value is 500.
What about "PHP_FCGI_CHILDREN=XX" ?
Is there an option like that for lsapi or is it handled differently? How?


Thanks in advance.
Reply With Quote
  #7  
Old 05-28-2005, 04:11 PM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,590
Quote:
What about "PHP_FCGI_CHILDREN=XX" ?
there is no equivalent in litepseed php sapi, should set "instances" to match "max connections".
Reply With Quote
  #8  
Old 05-29-2005, 05:16 AM
ts77 ts77 is offline
Senior Member
 
Join Date: Nov 2004
Posts: 288
How does that work with php-caches like eaccelerator or mmcache?
I've had problems with them if the php-processes are spawned depending on the load which would lead to multiple php-instances not controlled by one php-process.
The php-caches would have their own separate shm-segment for each php-instance which doesn't make too much sense.
Your architecture *sounds* like it would produce the same result. Or do php-caches even work with it?
Reply With Quote
  #9  
Old 05-31-2005, 09:50 AM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,590
I will check this issue, if it is like what you described, we will make some change to the SAPI module.
Reply With Quote
  #10  
Old 06-01-2005, 05:40 AM
ts77 ts77 is offline
Senior Member
 
Join Date: Nov 2004
Posts: 288
Yes, this problem exists here too:
# ipcs

------ Shared Memory Segments --------
key shmid owner perms bytes nattch status
0x02a622c7 0 nobody 777 1 0
0x02a622c6 32769 nobody 777 4096 0
0x00000000 458754 nobody 600 16777216 1 dest
0x00000000 491523 nobody 600 16777216 1 dest
0x00000000 524292 nobody 600 16777216 1 dest
0x00000000 557061 nobody 600 16777216 1 dest
0x00000000 589830 nobody 600 16777216 1 dest

(5 lsapi-php processes)
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
replacing system php felosi PHP 3 07-16-2007 11:23 PM
Usability issue with LSAPI PHP jrmarino PHP 5 05-08-2007 01:54 PM
setup php in rails template cswilliams Install/Configuration 2 01-25-2007 08:21 AM
Best configuration for PHP LiteSpeed SAPI jeff Install/Configuration 6 10-19-2005 09:54 AM
Custom PHP integration RikitZap Install/Configuration 2 04-25-2005 06:52 PM


All times are GMT -7. The time now is 10:02 PM.



- Archive - Top
© Copyright 2003-2011 LiteSpeed Technologies, Inc. All rights reserved. Privacy Policy.