Get XOOPS XOOPS FAQ Forums News Themes Modules
News World of XOOPS Developers Hacks Modules Themes Archive Submit News

XOOPS vs. Herko Coomans

Make a donation

Please select an amount to donate


Do you want your username revealed with your donation?
Yes - List me as a Generous Donor
No - List my donation as from an Anonymous Donor


Search

Local Support Sites

Cumulus Tag Cloud

admin Arabic banner block Christmas comments cumulus DayDawn dhsoft e-Commerce E-Learning Google GUI hacks instant-zero jQuery module news Nordic Olédrion oxygen PageRank security SEO simple-XOOPS sport tag Theme wiki xoops

New Users

Registering user

# 96568

dvsshoescom

Welcome to XOOPS!

Archives

XOOPS Code hosted on SourceForge

Optimizing Xoops, its modules and your server

Posted by instantzero on 2007/12/17 11:26:27 (5083 reads) | Posted on XOOPS
Sometimes, people are telling that Xoops is rather slow and it can be true but there are ways to improve things.

Instant Zero is in charge to maintain some websites using Xoops, so we decided to share with you our knowledge in this domain and we hope that you will find it useful.

In this article, and in 5 points, you are going to see what you can do for your site.





1/ the server
We are first going to look at your server and what you can do with it.
Depending of the type of server and contract you have, we recommend you to activate the gzip compression.
If your server is running Apache 2, then you need to activate the deflate module.
We will not talk of how to install and use it; you will find many good tutorials for this on internet.

“Modern” browsers (in fact it's running with not so recent browsers) can ask to the web servers to send then the page compressed.
There are many advantages of this, first there are fewer connections between the server and your navigator and secondly, you receive less data.
The counterpart of this is that you ask more work to your server. But it deserves it!
It's like compressing an html page with any zip program and sending it to your browser.
That's exactly the same and your browser surely can do it. For your server ... you have to see with your host.

If you can, we also recommend you to install and to use the Zend Optimizer or the eAccelerator extension.
Php6 should come with an opcode cache but until it is here, try to use another method to win some time.
With the Zend optimizer (or any other opcode caching system), the script which are the most used stay in memory in a precompiled state. Like this, your site does not need to interpret each script each time it is called.
With a Php extension like eAccelerator, ALL the Php scripts called by your site can be saved in a “compiled” state to your hard disk. It requires as many disk space as you have scripts (and even a little more), but it's also a great help to have a quicker site.


2/ Xoops by itself
The problem with CMS is that everything is dynamic, so the database is often used, and it's also true with Xoops.
But Xoops uses a template system called “Smarty” and this one enables you to use a caching system.
Whereas this cache system can cause problems when it is globally used on modules pages, it can be very useful on your modules blocks.
And often, you site's top page uses many blocks.
So don't forget to apply some cache to your blocks, you can do it in the Xoops blocks manager, edit the block and select a cache duration.
One last recommendation, on many website for which we are doing maintenance, we can see this option activated “Check templates for modifications?”
Definitively, except if you are working on your theme, deactivate this option (set it to No)!


3/ Database
Your database is called on every page. It is called by Xoops and by your modules.
With time and use, your database can become “unoptimized“, so we first recommend you to install and configure XoopsCare.
With this module, you can plan some regular optimizations process for your database.

There's something you must know, if you have a crash problem with your database one day, it's easier (when it's possible) to recover data from a database which is often optimized than from a database which is never optimized and it's quicker for your site.

Depending of the traffic your site has, you can select a greater of lower value for the “Maintain database every ...” option. We also recommend you to use the “Cache and Templates_c” option and the “Emtpy Sessions”
While we are talking of sessions, the longer session you set, the greater (and longer) your database you fill!
And don't forget that a robot like Google uses sessions ...

Still when talking of the database, we are going to finish this section of this article with some optimizations you can bring to the Mysql tables used by Xoops and the modules installed on your website.

Before to do any change on your database, we strongly advise you to do a full backup of it (content and structure).

As you may know, Xoops uses a database for its content. The modules too.
Each module has its own Mysql tables. It consists of a structure (a name and fields) and of data.

Each table can have as many indexes as you want.
Indexes are used to get quicker searches but as a counterpart, what you win during the reading process is lost when you insert data because you need to insert data in the table and to update the index.
But often, your website is more used in reading than in writing. So if you have speed problems with your site, then you can add some indexes where it can be useful.

So, to add indexes to your site, and after you made the backup, we recommend you to use a script like Phpmyadmin to add indexes to your tables.
Adding indexes is a very simple operation. Once you have clicked (on the left) on the table's name, then its structure is visible on the right and you will see a link, or an icon, to add an index on the desired field(s).

We are going to see the Xoops tables where you can add some indexes and what fields you can index.

a) The “modules” table (something like “xoops_modules” on your site, depending of the prefix you used during the installation but in this article we will call it “xoops”). In this table, the modules installed on your site are declared. You can add index to those 3 fields, “isactive”, “weight” and “hascomments”.

b) xoops_users. This table stores the list of all the users of your site. You can index the “level” field.

c) xoops_online. This table is used by the “who is online block” (and its content is only filled when this block is visible). You can index the fields “online_updated” and “online_uid”

d) Xoops_config. In this table, are saved all the configurations, for Xoops and for the modules. You can add index to the “conf_order” field

e) xoops_xoopscomments. As the name suggest, this table contains the comments of all the modules. You can index the “com_status” field

f) Now we are going to see some tables' modules. First, multiMenu. That's a very popular module that you can use to create, as the name suggest, some menus. On the tables of this module, you can index the “weight”, “hide” and “submenu” fields.

g) News. The News module is also a well known module to create articles. You can add an index on the field “published” of the “xoops_stories” table.

h) extCal is an excellent agenda. In the “xoops_extcal_event” table, you can index “event_start”, “event_end”, change “event_approved” from int(11) to tinyit(1) and index it. You can also index the “cat_id” field. If you want, you can also add another index composed of “event_start” + “event_end” + “event_approved“

i) Smartsection, this is a module used to create pages. In its table called xoops_smartsection_items, you can index the “status” and “datesub” fields. Still in this module, in the table called “xoops _smartsection_categories”, you can index the “parentid” and “weight” fields.

j) XoopsPoll, this is a module used to create polls. In its table called xoops_xoopspoll_desc, you can index the “weight” field.

k) Newbb. This is forum for Xoops. In its table called “xoops_bb_online”, you can add an index on the “online_uid” field and in its table called “xoops_bb_topics” you can index the “approved” field. For the “xoops_bb_posts” table, you can index the “approved” field. Finally, in the table called “xoops_bb_forums”, you can add an index on the “parent_forum” field.

l) Catads. This is an excellent module to make ads. In the “xoops_catads_ads” table, you can index the “waiting”, “published”, “expired”, “uid” and “cat_id” fields. In its table called “xoops_catads_cat”, you can add index to the “weight” and “pid” fields

m) SmartFAQ is a FAQ module, in its table called “xoops_smartfaq_categories”, you can add an index on the “parentid” field.

This is not a complete list. You can surely find tables which need more indexes and even tables without indexes.
If you are a developer or an experience user, you can activate the “slow queries log” of your Mysql installation.
If you are not a developer or an experienced user, then, you can at least see, via Phpmyadmin, if the tables used by your site have indexes.


4/ Files used
Some files are used on every page, that's the case of the file xoops.js.
You can find this file on your website, in the “include” folder.
If you use a standard theme, then this file is called on every page of your site.

With a program like jsmin, you can “minify” its size.
This can seems ridiculous but on website with many traffic, it can help your site to run faster.

You can apply jsmin on any other Javascript file you are using, for example jQuery or Prototype.
As a general role, for Javascript files, place these files as low as possible in the code of your theme.
You can also apply this rule to the Google Analytics code (if you use it) and to Google Ads.

Another kind of file that is used by your websites, that's pictures.
Try to reduce your pictures weight as much as possible.
If you are working with Photoshop, then export them for the web and try to compress them as much as possible.
If you are not using Photoshop, then I recommend you to use XnView (available under Windows and Linux).


5/ CSS
Your site certainly use a CSS file called from your theme. Verify that this file does not contain too many comments and remove them if necessary.
Place the call to your CSS files at the very top of your theme, this is a way to win some time.


Conclusion
Don't hesitate to contact us if you need some services for Xoops.

Instant Zero, your Xoops specialist.


Printer Friendly Page Send this Story to a Friend Create a PDF from the article


Bookmark this article at these sites

                   

The comments are owned by the poster. We aren't responsible for their content.

Excellent contribution!! Thanks
Posted: 2007/12/17 14:12 • Updated: 2007/12/17 14:12
Thanks Instant Zero for this optimizing guide, you have read my mind. I had testing a new site and it was taking more than 30secs to load uff... Now it is loading in less than 5 sec great!!
Posted: 2007/12/17 17:06 • Updated: 2007/12/17 17:06
Merci hervé
Posted: 2007/12/17 19:20 • Updated: 2007/12/17 19:20
Thanks Herve
Posted: 2007/12/18 3:10 • Updated: 2007/12/18 3:10
Quote:
Thanks Instant Zero for this optimizing guide, you have read my mind. I had testing a new site and it was taking more than 30secs to load uff... Now it is loading in less than 5 sec great!!


So what did you change?

And yes, thank you Herve for this contribution!!!
Posted: 2007/12/18 9:30 • Updated: 2007/12/18 9:30
Quote:
So what did you change?

First I activate the gzip compression. I have never seen this option in preferences, I am so ...
Then I setup cache in blocks and in two modules.
What I am not sure is which are the better cache values, higher or lower.
I was really worried because I have installed some xoops sites and I have never had this kind of slow perfomance.
I still want to tests table recommendations according with this guide.
Posted: 2007/12/18 10:49 • Updated: 2007/12/18 10:49
Superbe contribution Hervé, Merci beaucoup!
Posted: 2007/12/18 12:41 • Updated: 2007/12/18 12:41
Nice work Herve, especially on the DB optimisation tips. For IIS users I wrote a similar guide a while back which also incorporates some stress testing to help quantify what sort of performance gains can be achieved.
Posted: 2007/12/19 5:49 • Updated: 2007/12/19 5:49
Thanks all.

Brash, by the way, have you tested FastCGI with IIS ?
Posted: 2007/12/19 7:26 • Updated: 2007/12/19 7:26
Hi Herve,

Certainly have ! I'm really impressed with the work done with Microsoft's FastCGI handler, and I've even done some performance testing with it. Performance wise it is not that much different to ISAPI, or even the old PHP community version of FastCGI for IIS. There are still a few bugs here and there, but once these are ironed out it will bring a lot of stability and scalability (especially with multi CPU/core systems). It is great to see some momentum been put behind PHP on IIS like this
Posted: 2007/12/19 9:53 • Updated: 2007/12/19 9:53
Something else to try on mentioning Zend optimization, is disabling some of the points it mentions in its own user guide and still waiting for a response from them.....To see about using htaccess to do so, yet it does appear to work....

As for indexing, the technique you are mentioning (increasing indexing) is how that really long thread started on Mysql optimization of Xoops.....yet after much playing around i found it is better overall to remove all excess indexing, don't use text based indexing, and basically to make the primary index reach an id for a line of information in that table as fast as possible.....else what happens is you can get clumpiness, especially where you have MySql errors existing with multiple calls of the same fields....

It is also harder for information to be written into an index, in comparison of having a single primary id indexed and then allowing that data to be retrieved and stored in the table…..

MySql also retrieves long data from a table faster then from an index for some reason….so things like names and long character lists should only be from tables…

Thanks for all the advice and glad to see some of us are working on going faster….
Posted: 2007/12/19 12:03 • Updated: 2007/12/19 12:03
thanky thanky dude ;)
Posted: 2008/10/8 8:30 • Updated: 2008/10/8 8:30