Archive for August, 2010
Leaving the LAMP Stack
Aug 7th
Starting from yesterday, I decided to leave the LAMP stack for better. I know LAMP stack is very famous for its simplicity and power. But it was just plain old.
New things happen everyday, and I many of existing technologies cannot follow them fast enough, bringing way for new players. For example, Apache has its event-mpm in experimental for long time, but normally we still sicks to ageing prefork or worker mpm.
I know my server I am setting this up is quite powerful. I know even with its Traditional LAMP Stack with prefork-mpm and PHP as apache module can survive at least 500 concurrent connection. But that would totally consume every little bit of resources that I can’t run other things any more.
And also, I have hatred mod_php for long time. I would prefer CGI, if it is as powerful and secure as mod_php. So far I know about FastCGI interface, but setting up on Apache with standard php-cgi.exe is plain hell for me. Another reason I set up my old server as Apache and mod_php is because my hosting provider, AppservHosting, set their server up this way. And this is requirement for most PHP scripts out there.
I just discovered PHP-FPM (PHP FastCGI Process Manager) recently, and this is really what I needed.
Now I just need more powerful server with low CPU consuming and small memory footprint, but must support FastCGI interface. So far, after a while of searching, I come up with three web servers — nginx (pronounce engine x, but I pronounce n-jinx), lighttpd and cherokee. From this list, cherokee is the only processed-based web server. Other are using non-blocking I/O. I am still surprise why a processed-based web server has such high performance.
After surfing and reading for a while longer, I decided on nginx. Lighttpd has a memory leak, and I hate admin UI (that why I hate Abyss Web Server).
I don’t know why, but it seems that Apache is a web server standard. Maybe because it is the most successful? Oh, and by standard I mean many web servers take after it.
So I settled with nginx and PGP-FPM. Right here I am waiting for ‘make test’ to complete. I build everything from source this time.
Another reason I chose nginx is that it first started as a reverse-proxy server. This is a feature I require the most. So I can proxy the request to Apache backend (yes, I still use Apache as a backend server) for tasks that can’t be done in nginx such as CGI or WSGI.
But after that my ideas goes wild. I think I will install thttpd as a CGI server, Apache for passenger and WSGI (I still don’t trust nginx on this), OpenJDK+Jetty for Java. And also install GoogleV8FastCGI and Perl FastCGI on nginx. Well, if I run these all, it would probably be the most cumbersome web server ever!
The Design of the Active-Grader system.
Aug 6th
The Active-Grader system (previously known as OpenGrader, but due name conflict with existing open-sourced project I can’t register that name on Google Code) is a system designed to be a unified grading system for programming contest.
From my last post, Aj. Jittat (more commonly known as Aj. Manow) gave me this valuable feedback:
I think that the problem is not about open-sourcing the grading system. It’s more about configuration and documentation. Different contests have different rules. Different task types need different grading methods and submission interfaces: think about output-only tasks or interactive tasks. These clearly make the grading systems some crazy beasts.
Very thanks to him, I finally come out with final design that suite all needs I can think of programming contests.
More >