PERL / Catalyst test and benchmark

Initializing

First of all I have created the environment for the test. On the previously cloned machine the database has been imported and started. The data I used is from one of my webshops’ database called gumibomba_dev. It has more than 20k products which I can test the framework with.

Install PERL and Catalyst framework

You’re gonna need make, gcc and cc to be able to do this.

Method followed by the description below http://wiki.catalystframework.org/wiki/installingcatalyst

Check perl installation on server

We need cpan for installing further CPAN packages

Install Catalyst and its dependencies

This will ask for some confirmation (typically “Shall I follow them and prepend them to the queue of modules we are processing right now?”). Read those and answer yes. Sometimes it just want to install temporary basis for testing.

This will take some time.

First steps

When the installation finished (on the test box almost took more then an hour) we can create or Catalyst project.

This has created our new project. We can run the development server now to see it’s working.

And it’s working very well. In my humble opinion installation process was a pain in the ass. But you have to do this just once.

Import module definition from database

We’re gonna need to install some helper for this.

After finished the installation we’re able to import schema from database and create the scaffold around the desired model.

Important!

If you use UTF-8 charset in your DB you should be aware of the followings:
http://wiki.catalystframework.org/wiki/tutorialsandhowtos/using_unicode

Create the first application

In the lib/sandbox/Controller/Gumi.pm we create two methods:

The index will list 10 elements from “gumi” table through the DBIx ORM. The show method will show one element from “gumi” table. There’s no explicit query either of them. All object are provided by ORM layer.

The templates are

Nginx and FastCGI

To be able to run as fastcgi we’re gonna need FCGI/ProcManager.pm.

I don’t want to go in to details how to make fastcgi socket and use nginx to work with it. If you’re searching for nginx+fastcgi+perl+catalyst in your favorite engine you will find a lot of results describing it properly.

Results

The test was made by apache benchmark. I did 1000 requests for index and show pages with 5, 20 and 50 concurrency level. The numbers are the requests/sec. The memory and cpu usage was almost the same no matter how many thread was set for the ab test.

  Index Show
AB 5 conc 93,7 122,76
AB 20 conc 94,39 122,18
AB 50 conc 94,51 120,24
     
Memory usage 11,40% 11,40%
CPU usage 27,20% 25,10%

Python: Django framework »

You might like these too

Framework comparison (PHP, PERL, Python) My first "program" was a BASIC script on Commode 64. It was able to print some text on the screen twenty times. The text was "Hello world". I copied i...
HP Microserver ZFS benchmark with dedup I have a HP MicroServer which I'm very satisfied with. I bought this right away when HP announced it when it still didn't have a retail price determin...
Solr benchmark – first blood This is a quick impression about the freshly installed Solr 3.5 server. Enviroment The base system is a Amazon Microinstance equivalent virtual mach...