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

Go Back   LiteSpeed Support Forums > LiteSpeed Web Server > Install/Configuration > slow result

Reply
 
Thread Tools Display Modes
  #1  
Old 11-02-2006, 07:50 PM
shadowlight shadowlight is offline
Member
 
Join Date: Nov 2006
Posts: 19
Default slow result

Hi,

My issue will be long to explain but I will try to put as much information as it is possible.

Here are my system :

CPU 3 Ghz (no HT no dual core) 32 bit
2G ram

@@ OS and Web Server @@
I'm running FreeBSD 6.1 with Litespeed 2.2.1 (the latest for FreeBSD)


@@ PHP @@
php -v
PHP 5.1.6 (cli) (built: Nov 2 2006 23:10:09)
Copyright (c) 1997-2006 The PHP Group
Zend Engine v2.1.0, Copyright (c) 1998-2006 Zend Technologies


@@ MySQL @@
mysql Ver 14.12 Distrib 5.0.24a, for portbld-freebsd6.1 (i386) using 5.0

@@ Litespeed @@
I have the latest version for FreeBSD of enterprise litespeed 1 CPU lease 1 Year. Currently running on the temp license the time to receive my full license.

@@ LiteSpeed Config file @@
<?xml version="1.0" encoding="UTF-8"?>
<httpServerConfig>
<serverName>xxxx:80</serverName>
<user>www</user>
<group>www</group>
<priority>-5</priority>
<chrootPath>/</chrootPath>
<enableChroot>0</enableChroot>
<inMemBufSize>300M</inMemBufSize>
<swappingDir>/tmp/lshttpd/swap</swappingDir>
<autoRestart>1</autoRestart>
<autoFix503>1</autoFix503>
<mime>$SERVER_ROOT/conf/mime.properties</mime>
<showVersionNumber>0</showVersionNumber>
<adminEmails>xxxxxx</adminEmails>
<adminRoot>$SERVER_ROOT/admin/</adminRoot>
<logging>
<log>
<fileName>$SERVER_ROOT/logs/error.log</fileName>
<logLevel>DEBUG</logLevel>
<debugLevel>0</debugLevel>
<rollingSize>10M</rollingSize>
<enableStderrLog>1</enableStderrLog>
</log>
<accessLog>
<fileName>$SERVER_ROOT/logs/access.log</fileName>
<rollingSize>10M</rollingSize>
<keepDays>30</keepDays>
<compressArchive>0</compressArchive>
</accessLog>
</logging>
<indexFiles>index.html,index.html.var,index.php,in dex.php3,index.phps</indexFiles>
<htAccess>
<allowOverride>2</allowOverride>
<accessFileName>.htaccess</accessFileName>
</htAccess>
<expires>
<enableExpires>1</enableExpires>
<expiresDefault></expiresDefault>
<expiresByType>image/*=A604800, text/css=A604800, application/x-javascript=A604800</expiresByType>
</expires>
<tuning>
<maxConnections>1024</maxConnections>
<maxSSLConnections>200</maxSSLConnections>
<connTimeout>75</connTimeout>
<maxKeepAliveReq>1000</maxKeepAliveReq>
<smartKeepAlive>1</smartKeepAlive>
<keepAliveTimeout>5</keepAliveTimeout>
<sndBufSize>0</sndBufSize>
<rcvBufSize>0</rcvBufSize>
<eventDispatcher>kqueue</eventDispatcher>
<maxCachedFileSize>4096</maxCachedFileSize>
<totalInMemCacheSize>20M</totalInMemCacheSize>
<maxMMapFileSize>256K</maxMMapFileSize>
<totalMMapCacheSize>40M</totalMMapCacheSize>
<useSendfile>1</useSendfile>
<SSLCryptoDevice>null</SSLCryptoDevice>
<maxReqURLLen>4096</maxReqURLLen>
<maxReqHeaderSize>8192</maxReqHeaderSize>
<maxReqBodySize>10M</maxReqBodySize>
<maxDynRespHeaderSize>4K</maxDynRespHeaderSize>
<maxDynRespSize>1M</maxDynRespSize>
<enableGzipCompress>1</enableGzipCompress>
<enableDynGzipCompress>1</enableDynGzipCompress>
<gzipCompressLevel>5</gzipCompressLevel>
<compressibleTypes>text/html</compressibleTypes>
<gzipAutoUpdateStatic>1</gzipAutoUpdateStatic>
<gzipStaticCompressLevel>6</gzipStaticCompressLevel>
<gzipMaxFileSize>1M</gzipMaxFileSize>
<gzipMinFileSize>300</gzipMinFileSize>
</tuning>
<security>
<fileAccessControl>
<followSymbolLink>1</followSymbolLink>
<checkSymbolLink>0</checkSymbolLink>
<requiredPermissionMask>000</requiredPermissionMask>
<restrictedPermissionMask>000</restrictedPermissionMask>
</fileAccessControl>
<perClientConnLimit>
<staticReqPerSec>0</staticReqPerSec>
<dynReqPerSec>0</dynReqPerSec>
<outBandwidth>0</outBandwidth>
<inBandwidth>0</inBandwidth>
<softLimit>10</softLimit>
<hardLimit>1000</hardLimit>
<gracePeriod>15</gracePeriod>
<banPeriod>300</banPeriod>
</perClientConnLimit>
<CGIRLimit>
<maxCGIInstances>20</maxCGIInstances>
<minUID>11</minUID>
<minGID>10</minGID>
<priority>0</priority>
<CPUSoftLimit>10</CPUSoftLimit>
<CPUHardLimit>50</CPUHardLimit>
<memSoftLimit>60M</memSoftLimit>
<memHardLimit>70M</memHardLimit>
<procSoftLimit>400</procSoftLimit>
<procHardLimit>450</procHardLimit>
</CGIRLimit>
<accessDenyDir>
<dir>/</dir>
<dir>/etc/*</dir>
<dir>/dev/*</dir>
<dir>$SERVER_ROOT/conf/*</dir>
<dir>$SERVER_ROOT/admin/conf/*</dir>
</accessDenyDir>
<accessControl>
<allow>ALL</allow>
<deny></deny>
</accessControl>
</security>
<extProcessorList>
<extProcessor>
<type>lsapi</type>
<name>phpLsapi</name>
<address>uds://tmp/lshttpd/lsphp.sock</address>
<maxConns>20</maxConns>
<env>PHP_LSAPI_MAX_REQUESTS=500</env>
<initTimeout>60</initTimeout>
<retryTimeout>0</retryTimeout>
<respBuffer>0</respBuffer>
<autoStart>1</autoStart>
<path>$SERVER_ROOT/fcgi-bin/lsphp</path>
<backlog>100</backlog>
<instances>20</instances>
<priority>0</priority>
</extProcessor>
</extProcessorList>
<scriptHandlerList>
<scriptHandler>
<suffix>php,php3,php4,php5,phps</suffix>
<type>lsapi</type>
<handler>phpLsapi</handler>
</scriptHandler>
</scriptHandlerList>
<virtualHostList>
<virtualHost>
<name>ApacheMain</name>
<vhRoot>/usr/home/www/default/html/</vhRoot>
<configFile>$SERVER_ROOT/conf/ApacheMain.xml</configFile>
</virtualHost>
<virtualHost>
<name>xxxxxx</name>
<vhRoot>/usr/home/www/xxxxx/html/</vhRoot>
<configFile>$SERVER_ROOT/conf/xxxxxx.xml</configFile>
</virtualHost>
</virtualHostList>
<listenerList>
<listener>
<name>*:443</name>
<address>*:443</address>
<binding></binding>
<secure>1</secure>
<vhostMapList>
<vhostMap>
<vhost>www.example.com:443</vhost>
<domain>www.example.com:443, *</domain>
</vhostMap>
</vhostMapList>
<keyFile>/usr/local/etc/apache2/ssl.key/server.key</keyFile>
<certFile>/usr/local/etc/apache2/ssl.crt/server.crt</certFile>
<ciphers>ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM: +LOW:+SSLv2:+EXP:+eNULL</ciphers>
</listener>
<listener>
<name>xxxxxx:80</name>
<address>xxxxxx:80</address>
<binding></binding>
<secure></secure>
<vhostMapList>
<vhostMap>
<vhost>xxxxxxxx</vhost>
<domain>xxxxxx, *</domain>
</vhostMap>
</vhostMapList>
<keyFile></keyFile>
<certFile></certFile>
<ciphers></ciphers>
</listener>
<listener>
<name>Default</name>
<address>*:80</address>
<binding></binding>
<secure>0</secure>
<vhostMapList>
<vhostMap>
<vhost>Example</vhost>
<domain>*</domain>
</vhostMap>
</vhostMapList>
<keyFile></keyFile>
<certFile></certFile>
<ciphers></ciphers>
</listener>
</listenerList>
</httpServerConfig>


@@ Vhost config file @@

<?xml version="1.0" encoding="UTF-8"?>
<virtualHostConfig>
<docRoot>/usr/home/www/xxxxxx/html/</docRoot>
<enableGzip>1</enableGzip>
<adminEmails></adminEmails>
<logging>
<log>
<useServer>0</useServer>
<fileName>/usr/home/www/xxxxx/logs/error_log</fileName>
<logLevel>INFO</logLevel>
<rollingSize>20</rollingSize>
</log>
<accessLog>
<useServer>0</useServer>
<fileName>/home/www/xxxxxx/logs/access.log</fileName>
<pipedLogger></pipedLogger>
<logHeaders>7</logHeaders>
<rollingSize>20</rollingSize>
<keepDays>10</keepDays>
<bytesLog></bytesLog>
<compressArchive>1</compressArchive>
</accessLog>
</logging>
<expires>
<enableExpires></enableExpires>
<expiresDefault></expiresDefault>
</expires>
<contextList>
<context>
<type>cgi</type>
<uri>/cgi-bin/</uri>
<location>/usr/home/www/xxxxx/cgi-bin/</location>
<accessControl>
</accessControl>
<rewrite>
</rewrite>
</context>
</contextList>
<rewrite>
<rules></rules>
</rewrite>
<awstats>
<updateMode>2</updateMode>
<workingDir>/home/www/xxxxxx/html/xxxxx/stats</workingDir>
<awstatsURI>/xxxxx/stats/</awstatsURI>
<siteDomain>xxxxxxx</siteDomain>
<siteAliases>xxxxxxx</siteAliases>
<updateInterval>3600</updateInterval>
<updateOffset></updateOffset>
<securedConn>0</securedConn>
<realm></realm>
</awstats>
</virtualHostConfig>
Reply With Quote
  #2  
Old 11-02-2006, 07:50 PM
shadowlight shadowlight is offline
Member
 
Join Date: Nov 2006
Posts: 19
@@ System logs /var/log/messages @@

Nov 2 21:11:57 Navy4 kernel: pid 50032 (httpd), uid 80: exited on signal 6
Nov 2 21:11:57 Navy4 kernel: pid 49997 (httpd), uid 80: exited on signal 6
Nov 2 21:11:57 Navy4 kernel: pid 50067 (httpd), uid 80: exited on signal 6
Nov 2 21:11:57 Navy4 kernel: pid 50235 (httpd), uid 80: exited on signal 6
Nov 2 21:11:57 Navy4 kernel: pid 50060 (httpd), uid 80: exited on signal 6
Nov 2 22:11:09 Navy4 kernel: pid 69743 (lshttpd.2.2.2), uid 80: exited on signal 11 (core dumped)
Nov 2 22:12:01 Navy4 kernel: pid 79646 (lshttpd.2.2.2), uid 80: exited on signal 11 (core dumped)
Nov 2 22:18:49 Navy4 kernel: pid 13817 (lshttpd.2.2.2), uid 80: exited on signal 11 (core dumped)
Nov 2 22:19:55 Navy4 kernel: pid 23858 (lshttpd.2.2.2), uid 80: exited on signal 11 (core dumped)
Nov 2 22:22:59 Navy4 kernel: pid 60002 (lshttpd.2.2.2), uid 80: exited on signal 11 (core dumped)
Nov 2 23:33:33 Navy4 kernel: pid 65316 (lshttpd.2.2.2), uid 80: exited on signal 11 (core dumped)
Nov 2 23:50:33 Navy4 last message repeated 5 times
Nov 3 00:07:20 Navy4 kernel: pid 4515 (lshttpd.2.2.2), uid 80: exited on signal 11 (core dumped)
Nov 3 00:13:51 Navy4 last message repeated 5 times
Nov 3 00:58:10 Navy4 kernel: pid 23588 (lshttpd.2.2.2), uid 80: exited on signal 11 (core dumped)
Nov 3 01:30:07 Navy4 kernel: pid 23866 (lshttpd.2.2.2), uid 80: exited on signal 11 (core dumped)


I compiled fscgi/lsphp from /usr/ports/lang/php5/work/php-5.1.6/sapi/litespeed as per the doc.

copy the litespeed php sapi source and copy it to the php source/sapi folder.
cd phpsource/ && ./configure --with-litespeed && make
cp phpsource/sapi/php litespeedroot/fscgi/lsphp



Symptom :

PHP is working but it is slow. I changed the timeout value to 25 instead of 75 but i had to put it back to 75 since i received timeout error.

I can see in my process list more than 20 lsphp process and 3-4 lshttpd

When I start lshttpd from litespeedroot/bin/lshttpd start or lshttpd.2.2.2 start it works fine.

When i stop lshttpd from litespeedroot/lshttpd stop or lshttpd.2.2.2 stop it return an error.
./lshttpd stop
[OK] Your trial license key will expire in 30 days!
[ERROR] LiteSpeed Web Server is running!

PHP has been installed from the ports.

php -m
[PHP Modules]
bcmath
bz2
ctype
curl
date
dom
exif
fileinfo
ftp
gd
gettext
iconv
libxml
mcrypt
mhash
mysql
openssl
pcre
PDO
posix
Reflection
session
SimpleXML
sockets
SPL
SQLite
standard
tokenizer
xml
xmlreader
xmlwriter
zip
zlib

[Zend Modules]

I use the kqueue module and litespeed accelerator (i think not sure)
I activate sendfile () module too.
Currently while testing I put the exact same concurrent connection as our apache setup. While apache were using all the RAM with 1024, litespeed used only 1.1G of Ram keeping 900M for more client. (this include mysql, php, webserver).

The Site has 50 000 member registered (will grow up to 150 000) and concurrent user were between 400-1024 (limit of apache for our server with 2G of ram before it swap too much)

We would like to reach 10 000 concurrent member with php and litespeed and mysql. (AT a minimum much more than 1024).


Right now since it is really slow, we are really deceived. But I think it's probably something i did or didn't who make it slow. I would greatly appreciate all help to get this server running and optimized. Since we paid for the license we would greatly appreciate to beat our apache setup.
Reply With Quote
  #3  
Old 11-02-2006, 08:43 PM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,583
Latest LSWS package for FreeBSD6.1
http://www.litespeedtech.com/package...reebsd6.tar.gz
Reply With Quote
  #4  
Old 11-02-2006, 08:55 PM
shadowlight shadowlight is offline
Member
 
Join Date: Nov 2006
Posts: 19
Hi,

Yes this is what I have.


By the way, I found why it was slow.

the php module was cap with 20 connections. I grow it to 100 and now it cans handle the load. I will test tomorrow on a busy hour to find out what it cans handle

If you have any suggest following my spec to optimized my setup, feel free to guide me.


Thank you,
Reply With Quote
  #5  
Old 11-03-2006, 09:21 AM
shadowlight shadowlight is offline
Member
 
Join Date: Nov 2006
Posts: 19
I'm still having an issue with litespeed. I cannot stop it from lshttpd stop.

Please advise.


Thank you,
Reply With Quote
  #6  
Old 11-03-2006, 09:23 AM
shadowlight shadowlight is offline
Member
 
Join Date: Nov 2006
Posts: 19
Hi,

Yesterday night, we had a load of about 70 request second and the server fall on his knee. It used all the ram and swap, Our apache setup did better at this time. I just shutdown litespeed and put apache back.

Any help is welcome. In fact, we would really need a quick start guide with someone experienced.


Thank you,
Reply With Quote
  #7  
Old 11-03-2006, 09:58 AM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,583
The command to stop lshttpd is "lswsctrl stop" not "lshttpd stop".

Is that for a vbulletin board?
You probably set "max connection" for lsphp module too high. usually, 20 is enough for most setup, unless your php scripts take long time to process.

First thing first is to make sure a php opcode cache work properly in your setup, usually, something will be added to a phpinfo page when it works, like APC or eaccelerator.

Usually, php 4.4.4 has better performance than php 5, so if your PHP code work with php 4, use php 4 instead. Make sure all required php modules has been compile into the binary.

We will help you here to tune the web server as much as we can. Also we have one-time installation service $149 to help people setup and tune their LSWS installation for their web site, if you really need help, please that a consideration if you have a hard time to tune it by yourself.
Reply With Quote
  #8  
Old 11-03-2006, 12:32 PM
shadowlight shadowlight is offline
Member
 
Join Date: Nov 2006
Posts: 19
Hi,

swsctrl stop give me the same error.


The one-time installation service $149 would be welcome, but I will give myself 7 days to try tuning it.


I will install php4 and will diminish the number of lsphp max connect. I will give the url for phpinfo in my next post.


Thank you,
Reply With Quote
  #9  
Old 11-03-2006, 12:48 PM
shadowlight shadowlight is offline
Member
 
Join Date: Nov 2006
Posts: 19
Hi,


How can I enable php acceleration?

Thank you,

Last edited by shadowlight; 11-03-2006 at 11:57 PM..
Reply With Quote
  #10  
Old 11-03-2006, 01:29 PM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,583
Please follow our Wiki to build APC opcode cache,
http://www.litespeedtech.com/support...p:opcode_cache

If you build your own php 4.4.4 binary, you can just do "admin/misc/enable_php.sh" to turn on APC code cache.

If APC code cache has been installed properly, you will see a table regarding APC status in phpinfo output.
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


All times are GMT -7. The time now is 04:00 PM.



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