|
KMFMS Discuss why and how to avoid Microsoft
|
<<< Back to KMFMS home
View previous topic :: View next topic |
Author |
Message |
Guest
|
Posted: Fri Aug 19, 2005 6:16 am Post subject: lighttpd web server som general questions |
|
|
While browsing for web servers on the Internet i came accross interresting information of a web server named lighttpd.
I wonder if you are willing to give me (as newbe in embedded Linux) some quick comments
about it ?
a)
As i see it there are not many free web servers giving PHP functionallity, AppWeb and Lighttpd
being the ones i have found. Are there any other options ?
b)
I am not sure if i need PHP yet, maybe we will use CGI instead. For CGI som more options
exists.
Are PHP the preffered method theese days ?
My project is to extract data from a microcontroller based system running embedded Linux, so i
need some way of enabling dynamic web pages to update variables and measurement data in
client browser window.
c)
Compared to Boa and Thttpd (which to my knowledge has no PHP support) how do you find the
Lighttpd with regards to speed/CPU load and memory image size ?
We use a target running a ARM9 based processor at 180MHz.
Have a nice day ;o) |
|
Back to top |
|
|
admin Site Admin
Joined: 20 Jul 2005 Posts: 93
|
Posted: Fri Aug 19, 2005 4:06 pm Post subject: |
|
|
Hello,
My response is in-line below.
Anonymous wrote: | a)
As i see it there are not many free web servers giving PHP functionallity, AppWeb and Lighttpd
being the ones i have found. Are there any other options ? |
How much memory do you have to work with? Apache could be a good option if memory isn't too constrained and the demand on the server isn't going to be enormous. I used to run Apache on my intranet server, which was a Pentium 90MHz, and the performance was perfectly fine.
Anonymous wrote: |
b)
I am not sure if i need PHP yet, maybe we will use CGI instead. For CGI som more options
exists.
Are PHP the preffered method theese days ?
My project is to extract data from a microcontroller based system running embedded Linux, so i
need some way of enabling dynamic web pages to update variables and measurement data in
client browser window.
|
PHP is possibly the most popular method of creating dynamic web pages on Linux. It is easy to install, extremely widely available, and easy to pick up and write something really quick with. The ease of use can be a downfall as well since it is very easy to write something in PHP but not nearly as easy to write something which is secure. More recent versions of PHP have been more secure out of the box than previous versions, so at least that aspect is improving. Personally, I prefer Tomcat with JSP and Servlets since the libraries are a bit more elegant, but that may not be an option if you have constrained computing resources.
CGI could potentially be even more lightweight than PHP. The downside is that it can be a chore to do anything mildly complicated with CGI. It could be a good option if your needs are very simple, especially since CGI is probably more widely supported than PHP. I would recommend CGI for very simple interactions, PHP for very simple to moderately complex systems, and JSP/Servlets/J2EE for moderately complex to very complex systems, provided you have sufficient resources.
Anonymous wrote: |
c)
Compared to Boa and Thttpd (which to my knowledge has no PHP support) how do you find the
Lighttpd with regards to speed/CPU load and memory image size ?
We use a target running a ARM9 based processor at 180MHz.
|
Lighttpd trounces Boa, thttpd, and Apache in every category you listed*. To be fair, Boa and thttpd also trounce Apache, but they don't support PHP. Some web servers that I set up which get extremely high traffic had Apache in use initially, but the load would spike up above 100 and the machine would become unusable. I switched this to an Apache/Boa hybrid combination (Apache would redirect to Boa for large downloads), and that lowered the average load to around 2. Later, I tried replacing Boa with thttpd and that might have dropped the load to somewhere around 0.5 or 1. When I tried lighttpd by itself (it didn't need Apache since it supports PHP itself), the load dropped to something incredibly low, I would estimate around 0.1, though it frequently reads 0.00. (*Note: I don't have ready access to thttpd at the moment and I don't remember what the memory consumption was, so I'm not positive that lighttpd beat it in that category.)
Please note that the servers that I performed these tests on were under extreme load. They were serving rapid simultaneous requests for large files, frequently to users who had slow connections on their end. That is the one type of situation where Apache's limitations start to show. In general, Apache is a very capable web server and can handle most scenarios with good results.
I did need to write a cron script to restart lighttpd every so often. It would die inexplicably every other day or so. That may be due to the fact that I altered the source code for it, so I wouldn't rule it out on that anecdote alone. Automatically restarting it from cron is pretty simple anyway.
Lighttpd's memory usage on one of the servers that I installed it on which has been running for months is around 5M. It starts out much smaller than that, too. Boa, on the other hand, is using 6M at the moment. Note that the PHP memory usage is a totally separate issue since PHP runs in a separate set of processes as lighttpd connects to it via the FastCGI interface. I figure this is still a fair comparison to Boa given that Boa doesn't have PHP support in its primary process either. The PHP processes are around 3.5M each, and you can control how many of those are spawned.
- admin |
|
Back to top |
|
|
Riltlerry Guest
|
Posted: Sun Dec 11, 2011 6:52 am Post subject: |
|
|
этот
В этом что-то есть. Спасибо за совет, как я могу Вас отблагодарить? |
|
Back to top |
|
|
|
|
You can post new topics in this forum You can reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Forum posts are owned by the original posters.
Forum boards are Copyright 2005 - present, KMFMS.
Powered by phpBB © 2001, 2005 phpBB Group
|