Miscellaneous

Project: The qGrader

As of now, the OpenGrader is still an idea. I haven’t had any time to develop it, though its idea is evolve over time.

But hey! Look at my sentence: ‘Most user of contest environment already know how to code’. What is it again? Why do we need an easy to use contest environment with beautiful admin UI?

And there is Patta Grader, which took minimalist design with all code-base configuration.

Now the decision come when I am in need of immediate contest environment to use within two weeks (it is due on next Monday the 13th). If I have set up my server with Ubuntu 10.04LTS already, I would install cafe-grader within a blink of eyes. But since I still run Ubuntu 9.04, I can’t. (I don’t trust Ubuntu dist-upgrade) So far, I decided to take minimalist design with both web and grader, and now I present you the qGrader!

qGrader is a small and swift contest environment. Though it is very small, it is fast and I think it can handle load of hundreds users well (if run on Unix; Windows grader is far too slow). Currently the implementation uses SQLite database (I’m quite addicted to its dynamic typing), but if migrated to MySQL or larger RDBMS, it would run tons faster.

The downside of this system is that there is no central grading procedure for each task. Each task must have its own grading procedure (written in PHP, as is all the system except sandbox). There is built-in procedure for standard batch-type task for easily use, but you still have to write code.

But I consider this a very big advantage. It allow basically every type of task to be usable on this system. And I believe with a few adjustment, you could easily move the task and use system to be database-based too.

Currently I am testing it (I wrote it in past two days). I might write summary page, for all task and each task. An admin interface for managing task and user (directly writing to file). But I don’t think I will write a MySQL part for it — for me SQLite is enough and is for more easier to write and use.

Contact me if you want to try the grader. I don’t think I will ever published it. The code is real mess (the web part is coded in only one PHP file and several CSS and images and the the grader is also one big file with two of utilities file (for task grader))

Leaving the LAMP Stack

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!

Restaurant City on Facebook

Restaurant city popularity

Not sure if this is normal, but I’m quite proud of my level 13 and popularity of 40.5 (average 39.5, though). And I start playing this last Monday (Oct 26, ‘09)!!!

EDIT: I have 50 now, but it is normal for 18th level player to achieve maximum popularity.