• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Extremely slow speed on my site using codeignitor... is this normal?

#11
[eluser]pickupman[/eluser]
+1 for Phil's cache library. Dead simple to implement, and easy to convert calls to utilize the advantages of his library. I did take me awhile to realize and needed to return result objects rather than query objects from by models. I kept getting empty cache files.

#12
[eluser]bretticus[/eluser]
[quote author="alitech" date="1276052781"]I am not on a dedicated maching with a quad core 2.8 GHZ proc, 8GB ram and 1TB hard disk. This has not helped either as the server goes down constantly because of the load. I have been monitoring Apache and the maximum traffic I can achieve is about 180 threads at the same time.

I am told that with codeignitor on every page load, the index page is referenced/loaded as well? Is that right?
[/quote]

You are or are not on that server? That server seems perfectly adequate really if you meant you are on it. However, there is a lot of potential apache optimizations as 180 threads seems low for an 8GB quadcore! In fact, if you get alot of traffic, I'd even suggest dumping apache and going nginx and fast cgi with php-fpm. nginx uses an event loop and running out of memory with high volume is reportedly much better on nginx than apache. Again though, it seems to me that some tuning could help a lot on the apache end in the meantime.

If you are not using some kind of Op caching engine (APC, etc.) Do it! You can also store the results of your queries in APC for 30 minutes (or more depending on how static the data is on average.) When you say all those pages I assume you mean unique pages rendered from database code? Is the database service on the same server? Is it MySQL? Have indexes been setup for your tables (particularly for the joins?) Any attempt to optimize your database?

This really is something you need to hire a professional to delve into. It sounds like you've had several people look into optimizing the code, perhaps it wouldn't hurt to have an IT expert optimize your services.

Codeigniter does call index.php every time (so does wordpress, zen framework, and just about every php-based tool that is distributed on the Web.) CodeIgniter does a good job of only loading what files are needed at any given URL. In benchmarks (that I don't have) CodeIgniter has been shown to be well-optimized when compared to other popular PHP frameworks. That said, PHP, in general, does not scale well compared to say Java or ASP.NET. Doubt you wanna go that far, but food for thought.

Good luck!

#13
[eluser]alitech[/eluser]
Hey Bretticus

Many thanks for taking the time to respond to my query. Appreciate the suggestions and yes I have to say I have not idea if any of this has been done for my site. I know the quad core can take a lot more, thats why I came on to it in the first place. The 180 threads also only occur once a spider comes on to the site. I think spiders are killing the server with the load, which they shouldnt really. I moved to a dedicated server so that I dont get kicked out by shared hosting, VPS arrangements. For now, I think Apache will suffice until I find out what the underlying problem really is. I have a wordpress blog and a phpbb forum on the same box and they are lightening fast. And yes, the number of pages I refer to are all dynamic DB driven.

The MySQL optimisation and indexing would be required by the sound of this, I am sure thats not been done for the site.

Anyhow, if you could kindly support your suggestions with references on where I can find more information and downloads of these tools/tutorials, that would help. I can attempt to get them looked at by my developers in the first instance as the cost would be affordable. If not, I will have to hire a professional to fix these issues. I have big plans for the site. Not really gotten anywhere because of performance issues. Google doesnt like us at all as they now score on site speed as well.

If you guys have any suggestions as to who I can hire for a job like this, that would be excellent.

#14
[eluser]pickupman[/eluser]
In addition to the great advice above, and looking at your site, there seems a few ways to figure out the bottleneck. The output class has a lot of great tools for profiling your application. The output class has the ability to place start and end timers. You can put this in your code, and see if there are queries or iterations that are taking too much time. I am in the US, and your site doesn't seem to be loading horrible considering the amount and type of content. Are your caching your tag cloud, as this type of feature on this content could slow things up depending on how it is rendered.

What happens when you save the file to a static page, and open in your browser? Are your resources slowing up page load? I took a look with Firebug + YSlow, and seems like you could benefit from combining your js/css resources. Checkout the carabiner library for CI.

#15
[eluser]Mat-Moo[/eluser]
What hosting are you using? vps, shared. dedicated, cloud? I think knowing what your hosting it would be a good start.

#16
[eluser]caustic[/eluser]
alitech, I think you site will fall down soon if you would not make an attempt to optimise your DB (or place it in cluster) and site cms. If you suppose to get 10 millions entries in one table in one server... it will definitely fall down before you reach desirable 10 millions entries.

#17
[eluser]Unknown[/eluser]
Beside optimizing your db, you should reduce the count of http requests by using techniques like css sprites, or replace simple graphics by using css instead. check wether you can merge javascript files and compress them. check your headers for expiration timesout to cache files on client side.
at this url discount-deals you have 147 request for just one page! maybe the server can not handle these amount of connections.

good luck

#18
[eluser]Krzemo[/eluser]
Quote:I am not a techie (...)
From more biz POV...
I'm not sure how not techie you are not, but as you already know what to do more less, it would now best to hire someone and have a chance to have it solved ('workarounded', even temporarily) within one day and save your business Smile Additionally you might also learn if you application will stand the change you mention without smaller or bigger redesign (and redevelopment).

There is one thing sure - if its going to grow it will need constant maintenance...

Regs
K.

PS.
I'm not sure if it was mentioned already, but besides DB optimization - going for i.e. lighttpd and xcache gives sssserious boost.

#19
[eluser]alitech[/eluser]
I appreciate all the comments people have made here. It has opened my eyes really. I am still struggling to get this all tested, done, deployed as resource is an issue.

I have opened up profiling on my beta site. If you guys can please have a quick look at this, that would be great.

couponbunga.com
user ali pass ali123

Any comments and suggestions coming out of this excersize will be given the highest priority for my and my incompetant development team.

#20
[eluser]n0xie[/eluser]
I see a number of queries that are REALLY slow. Most take less than 0.002 but a couple are near 0.1. Also I see
Quote:DATABASE: couponb_voucher
QUERIES: 494
That is A LOT of queries. You should either cache a lot of these queries, or see if you can remove a lot of these.


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.