Elxis CMS Forum

Support => General => Topic started by: timalsina on September 06, 2009, 02:34:09

Title: Static cache vs. static page
Post by: timalsina on September 06, 2009, 02:34:09
Today I did a quick benchmark on Elxis powered dev. site vs equivalent static content served by Apache.

The test was done in following environment:

Hardware:
2.4 GHz Intel Core 2 Duo
Memory: 2GB 667 MHz DDR2 SDRAM
System: MacBook
OS: Mac OS X 10.6

Server Software:
Zend Community Server with following specs:

Apache: Apache/2.2.12
PHP 5.2.10
MySql: 5.1.32

Elxis Configuration:
Environment: Localhost (in local network)
Elxis Version: 2009.0
SEO PRO - Enabled
GZIP Page Compression: - Enabled
Number of Articles: 1
Number of Sections: 1
Number of Categories: 1
Number of Menu Items: 1
Public Frontend Modules Enabled: 2 (All frontend modules except Mainmenu and Search were disabled)
Number of Articles Displayed on Test Page: 1
Page tested: The frontpage (With 1 frontpage article, mainmenu and search module enabled)

Benchmark Software Used:
ApacheBench, Version 2.3

Benchmark Variables:
Number of requests made to site: 10,000
Number of concurrent users: 100

Case 1: ApacheBenchmark was fired with 10,000 requests and 100 concurrent users to Elxis powered site running with above configuration: Following is the result:

----------------------------------------------------------
Document Length:        3125 bytes

Concurrency Level:      100
Time taken for tests:   204.296 seconds
Complete requests:      10000
Failed requests:        0
Write errors:           0
Total transferred:      38930000 bytes
HTML transferred:       31250000 bytes
Requests per second:    48.95 [#/sec] (mean)
Time per request:       2042.964 [ms] (mean)
Time per request:       20.430 [ms] (mean, across all concurrent requests)
Transfer rate:          186.09 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    4  12.0      0     103
Processing:   159 2033 472.0   2047    4923
Waiting:      158 2030 472.0   2042    4923
Total:        163 2037 472.1   2051    4932

Percentage of the requests served within a certain time (ms)
  50%   2051
  66%   2215
  75%   2309
  80%   2370
  90%   2605
  95%   2777
  98%   2965
  99%   3206
 100%   4932 (longest request)

--------------------------------------End of Benchmark Case 1 Results ---------------------------------------

Case 2: Static content page that was generated by Elxis Static Cache was copied over to another instances of Virtual Host with exactly same configuration and the file was called directly to serve by Apache (pure static cache page generated by Elxis Static Cache), and following is the result of it:

---------------------------------------------------------------------------------------------
Document Length:        4348 bytes (Exactly the same file seems a bit bigger here. I think it is due to gZip is not applied here)

Concurrency Level:      100
Time taken for tests:   2.051 seconds
Complete requests:      10000
Failed requests:        0
Write errors:           0
Total transferred:      46448572 bytes
HTML transferred:       43497392 bytes
Requests per second:    4875.19 [#/sec] (mean)
Time per request:       20.512 [ms] (mean)
Time per request:       0.205 [ms] (mean, across all concurrent requests)
Transfer rate:          22113.83 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    1   0.6      0       4
Processing:     2   20   2.8     19      56
Waiting:        2   19   2.8     19      56
Total:          6   20   2.7     20      60
WARNING: The median and mean for the initial connection time are not within a normal deviation
        These results are probably not that reliable.

Percentage of the requests served within a certain time (ms)
  50%     20
  66%     20
  75%     21
  80%     21
  90%     23
  95%     26
  98%     29
  99%     32
 100%     60 (longest request)

--------------------------------------End of Benchmark Case 2 Results ---------------------------------------

Case 3:

Disabled Static Cache and load-stormed the server with same variables:

Results:  Server DIED!!!!


Conclusions:

Sure enough, Static Cache is the way to go to survive that kind of traffic. But, shockingly enough, serving plain static page (with exactly the same content) seems 100 TIMES faster!!!

I was wondering what causes Elxis to serve static content that slow even with both of them being identical. It hints that there is room to improve Static Cache altogether. What would be the logic to bypass Elxis altogether and just serve the Static Cache content which is equivalent to serving plain Static Page where serving just static content is applicable.



Title: Re: Static cache vs. static page
Post by: datahell on September 06, 2009, 09:30:42
Elxis does not serves you directly the cached page, it gets initialized, gets connected to the database, etc, and checks if it should serve you a cached or a non cached page. So, it is very normal to be slower that a plain HTML file.

When I was thinking about Static Cache development at first I was going to make it work via the htaccess file and without "touching" elxis core at all (by including the cached file directly from the "cache" folder). But this way it was impossible to handle static cache the way we need. If you deeply think of it you will understand the reasons of this implementation.

The most important conclusion in your benchmark is that Elxis is able to handle 10,000 requests without even 1 failed! And this without any server extension installed. Elxis 2009.0 with static cache +gzip can handle huge amounts of traffic.
Title: Re: Static cache vs. static page
Post by: timalsina on October 02, 2009, 12:47:13
When I was thinking about Static Cache development at first I was going to make it work via the htaccess file and without "touching" elxis core at all (by including the cached file directly from the "cache" folder). But this way it was impossible to handle static cache the way we need. If you deeply think of it you will understand the reasons of this implementation.

Datahell, I am going to deploy my site to Cloud Hosting Environment where the hosting company bills me based on CPU usage. If I get spike on site, obviously my bill will be really high! I could bypass it if I have a way to serve the homepage/landing page as static page and all other pages served by Elxis. Also, if there is spike on site, I have an option to switch to static page. I am working on a solution. Any input would be great. Looking forward to on 2009.1 and IOSReservations 3.x
Title: Re: Static cache vs. static page
Post by: ahmet on January 05, 2011, 15:40:12


When i changed to static cache i have found this error? In standart cache or no cache no problem occurs..
Anyone had the same problem or any advice..
thanks in advance..
www.globalpanorama.net

URI: index.php?option=com_content&task=blogcategory&sectionid=9&id=29&Itemid=105
Path: /includes/Core/staticcache.php
Line: 151
mkdir() [function.mkdir]: Permission denied
Title: Re: Static cache vs. static page
Post by: CREATIVE Options on January 05, 2011, 17:28:24
It is clear, you have permissions error.
Title: Re: Static cache vs. static page
Post by: ahmet on January 06, 2011, 12:20:53
but i do have its 777 chmod
Title: Re: Static cache vs. static page
Post by: webgift on January 06, 2011, 14:55:38
Try to remove the cache directory and create it again on root elxis directory.
Then change the permissions at cache directory to 777.

Enable the static cache and inform us.

In any case there is no need to enable Static Cache. Static cache enabled on huge traffic like elxis.org etc ;)
Title: Re: Static cache vs. static page
Post by: ahmet on January 06, 2011, 16:57:55
hello webgift,
eventhough i made the cache clean it didnot work..
in the future it will be a heavy loadad site.. flash panoramas are app. 2 mb. each .. and the site is near 1 gb.. at the moment..
here the error

PHP Hata [Warning]
URI: index.php?option=com_content&task=blogcategory&sectionid=9&id=34&Itemid=145
Path: /includes/Core/staticcache.php
Line: 151
mkdir() [function.mkdir]: Permission denied
 2nd error :

PHP Error [Warning]
URI: index.php?mylang=english
Path: /includes/Core/staticcache.php
Line: 151
mkdir() [function.mkdir]: Permission denied

thanks anyway...
i dont wanna play with the administrator too much..because i dont have any knowledge about php and mysql..
And i am looking for a pro whon can able to carry the site to another host, or solve problem if sth. occurs.
İaonnos has given ur name. Is it possible for you to work hourly basis for modifications etc. ?
thanks
www.globalpanorama.net
Title: Re: Static cache vs. static page
Post by: CREATIVE Options on January 06, 2011, 17:10:37
With the updiag tool check the installation tool.
Title: Re: Static cache vs. static page
Post by: webgift on January 06, 2011, 17:26:15
Have you removed and created again the cache directory ?
I think that you have clean the contents of it.

With the updiag tool check the installation tool.

It's necessary process that!

If you have faced the problem please send me a Private Message with ftp / administrator details to check this out!
Title: Re: Static cache vs. static page
Post by: ahmet on January 06, 2011, 17:34:06
i checked everthing is in order no need to update anything..