Jump to content

How to fasten the execution time


Recommended Posts

On my forum at bottom it says 'Exec. Time: 0.4713'

I have visited some other IPB forums and their execution time is way below then mine.. Can someone help me to speed up my execution time?

I am using php 5.3.x with apache2 as server handler and xcache. If their is anything anyone can suggest to speed up my forums it would be great!

Thanks

Link to comment
Share on other sites

I am on dedicated server with 8Gb RAM and quad core with HT enabled. It has plenty of room to even handle 500 users at a time which i hardly reach.

I believe it's something related to the php / apache. I am not sure how to fasten the execution time.

Link to comment
Share on other sites


I use memcache and although it is quirky, it does seem to improve performance. I am seeing on average between .18 and .23 sec.




I am using xcache since last couple of years and it's working quite well. I am not sure if I will gain any benefit from changing xcache to memcache.
Link to comment
Share on other sites

Have you done any apache, Mysql optimization ?

Mysql optimization will speed queries up which will show a faster time when you load the page. If it is default then just use the mysql tuner for improvement.

Link to comment
Share on other sites


Have you done any apache, Mysql optimization ?



Mysql optimization will speed queries up which will show a faster time when you load the page. If it is default then just use the mysql tuner for improvement.




I would need some help on apache optimization. For MySQL their are only 44 queries which took more then 2 seconds in last 5 days so I guess MySQL is running good.
Link to comment
Share on other sites

If your server config is fine the next direction is to cut down on the number of queries on your pages... for example on an ipcontent front page, I'll use one site as an example...

Forum page 10 queries = 0.0604
Front page (ip.content) 41 queries = 0.4038

So the page you are testing will also make a big difference on your times along with the number of queries. So Gary is correct in making sure that mysql is optimized the best it can be to execute the queries as fast as it can. If your on a shared host, not much you can do there, so simple optimizing your site and reducing the number of queries on each page is a good solution as well for a shared server.

Link to comment
Share on other sites


I am using xcache since last couple of years and it's working quite well. I am not sure if I will gain any benefit from changing xcache to memcache.



I could be wrong, but I think that xcache is an opcode cache where memcache is a data cache. I do not use xcache, I am using eAccelerator along with memcached. If you're having database performance issues, memcache may be worth trying.
Link to comment
Share on other sites


Forum page 10 queries = 0.0604


Front page (ip.content) 41 queries = 0.4038



So the page you are testing will also make a big difference on your times along with the number of queries. So Gary is correct in making sure that mysql is optimized the best it can be to execute the queries as fast as it can. If your on a shared host, not much you can do there, so simple optimizing your site and reducing the number of queries on each page is a good solution as well for a shared server.




Well yeah, I agree but issue is how IP.Content and default blocks are coded. IP.Content on my forums takes around same time.. 0.4 to 0.5 cos of 38 to 44 queries.

For forum its 8 queries and takes around 0.2 to 0.4 on peak times. Issue is even with 8 queries it's 0.2 in off peak times.



I could be wrong, but I think that xcache is an opcode cache where memcache is a data cache. I do not use xcache, I am using eAccelerator along with memcached. If you're having database performance issues, memcache may be worth trying.




Can you please point me to link where it explains difference between opcode and data cache? Can u run xcache and memcache together? Also what's difference in opcode and data cache?
Link to comment
Share on other sites


Well, memcache will cache your data avoiding a db access when the page is in memory. Investigate memcache to see if it's right for you.




Question: How can I tell forums to use memcache? I think in config.php I have mentioned xcache. Is their any specific settings I need to use for memcache?
Link to comment
Share on other sites

Just gloating...

My execution time is 99.9% of the time under 100ms. which includes heavy query ip.content :D

How? For me...
1. I use Nginx (lots of caching at various levels and multi-tiers -- though exec time would be ones that pass this step...) + php-fpm + mysql (myisam -- though, mariadb is probably better...) + memcached (I have multi server, can't do local user caches like apc/xcache) + sphinx + apc for opcache
2. Throw a lot of money at it. :D


Can you please point me to link where it explains difference between opcode and data cache? Can u run xcache and memcache together? Also what's difference in opcode and data cache?



op cache (operation cache) is a caching of the libraries used by php and the compiled version of php temporarily. This allows faster execution of the php itself without having to reference other places or having to recompile every single time.
data cache (aka user cache) is a caching of contents that were told to be cached by the user. So, if your php script says "store this", "get this", etc, these are user cache.

xcache and apc are forms of op cache and user cache. Meaning, they do both. The opcache nature is something you build into php itself. You do not define it to be used in IPB. You do, however, need to tell IPB to use its user cache.
memcache is a form of user cache only. They do not provide any op caching. Thus, if you have memcache for user cache, you should still install apc/xcache for opcache.
Link to comment
Share on other sites


Ok, i am confused now. So I can have both memcache and xcache on same machine?



OR



I can't and IPB only supports one as Rhett mentioned?



Thanks!




To clarify you can only set IPB to use one caching service in the config file.
Link to comment
Share on other sites


Ok, i am confused now. So I can have both memcache and xcache on same machine?



OR



I can't and IPB only supports one as Rhett mentioned?



Thanks!



It would be both.
You can install both on your machine. But, you can only tell IPB to use one of the two for user cache.

In other words, you can have 1 opcache per machine. (xcache, apc, eaccelerator)
You can have 1 user cache per IPB. (xcache, apc, memcached)
You can install multiple user caches per machine. But very few software are ever designed to use multiple forms of cache simultaneously. It's useless most of the time to do so.

But xcache/apc's user cache is strictly faster than memcache. memcache uses TCP connection. xcache/apc does not. The usage of TCP allows memcache to exist in a completely separate machine. xcache/apc cannot.

For example, facebook, some time ago explained their 2 tiered caching method.
They would have each server have apc to handle user cache. When apc would miss, they look into the memcache run in another server. If both caches miss, generate. With lot more complications ofc. ^^;
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...