Home Private Messages Search
CPG Dragonfly™ CMS
 
Wiki ⇒ The Project ⇒ Server/Resource impact

WikiThe Project ⇒ Server/Resource impact  

Glossary
The Project
Install
Upgrading or Switching
Dragonfly admininistration
Dragonfly public view
Dragonfly Themes
Build local server
Tips and Tricks
Rules & Regulations
v9 Developer's Manual
v10 Developer's manual
Wiki Permissions
2.8: Server/Resource impact Parent
How much does it use?

Dragonfly uses more CPU and memory then simple webforms because it runs thru a pre-processor (PHP)
Pre-processor code like asp, php and perl is similar to plain coding in C, Pascal or ASM which means they still have to be processed/compiled to get it to work.
Since it needs to be processed, php uses memory and cpu to compile and execute the code. This document will explain the difference between CMS's and PHP setups so you know "how much" Dragonfly is using.

CGI or MOD

There are 2 ways to run PHP: CGI and as Module.
When your server runs PHP as CGI it will use more CPU then as Module due to the overhead of executing PHP upon each request. If PHP is loaded as Module inside the HTTP daemon like Apache it is only executed once when Apache starts and will stay in memory to prevent constant loading of PHP and reduces the overhead.
Most hosting providers use PHP in CGI mode because it is somewhat difficult to properly modify PHP inside Apache without adding security risks (mainly due to lack of setuid knowledge).

PHP vs PHP

That's right -- there is a difference in PHP files on how each way works.
  1. Embed code in documents (fast)

    <html>
    <
    body>
    <?php
        echo $_SERVER['SERVER_NAME'];
    ?>
    </body>
    </html>


  2. Echo documents (slower)

    <?php
        
    echo '<html>
    <body>
    '
    .$_SERVER['SERVER_NAME'].'
    </body>
    </html>'
    ;


  3. Use templates (slowest)

    <?php
        $cpgtpl
    ->assign_var('SERVER_NAME'$_SERVER['SERVER_NAME']);
        
    $cpgtpl->set_handle('document''document.html');
        
    $cpgtpl->display('document');


Dragonfly aims to be #1 and #3 BUT #1 will only work if you have write access to the /cache/ directory. So how does that work?
We use themes and each theme consists of many images and template files. As you can see in #3 we must load variables, process the template file, and then finally display the merged result.
By using the /cache/ directory, Dragonfly only has to process the template file once and then stores a #1 compatible file inside the cache and loads that file instead for fast processing.
Due to this we reduce the the CPU load on a server drasticly, but this does mean a correct setup of the server.

OS

There are many Operating Systems around but the best known are FreeBSD, Linux and Windows. To get the most speed out of your server it is advised to choose FreeBSD or Linux since they are faster in disk drive handling then Windows which results in faster loading of your webpage.
Also, if you or your host has the money it is advised to be on a SCSI drive instead of IDE, again due the speed especially for the database handling.

SQL

As mentioned above MySQL and PostgreSQL need many disk access for reading, searching and writing so a fast drive is essential for heavily visited websites. Second, if this occurs, it's best to have the databases on a seperate hardrive (NOT partition) to prevent huge sector positioning on the drive.
If your SQL server CPU goes pretty high then turn on the cache capabilities of your SQL server (if it has such available).

 
Updated: Thursday, August 24, 2006 (14:50:51) by tuta
Created:  Monday, January 09, 2006 (12:46:14) by DJMaze

You are seeing squares or questionmarks on this page?

All content of this website is copyrighted by the Creative Commons NC-SA
The logos and trademarks used on this site are the property of their respective owners
We are not responsible for comments posted by our users, as they are the property of the poster.
Our server runs on a P3 1.2GHz with 512MB RAM with no accelerators
Support GoPHP5.org
Interactive software released under GNU GPL, Code Credits, Privacy Policy