Results 1 to 21 of 21
Thread: The Best Cache Solution
-
08-09-2012, 08:21 AM #1Temporarily Suspended
- Join Date
- Jul 2008
- Posts
- 273
The Best Cache Solution
Hello again everybody, I'm developing a script and I'm having doubts about what kind of cache to use parts of the code.
What would have higher performance and consume less server, the system will be aimed at high-traffic, about 4000 users browsing simultaneously.
smarty cache or memcached+memcache
What would be best solution ?
-
08-09-2012, 10:15 AM #2PING PONG
- Join Date
- May 2009
- Location
- SLASH ROOT
- Posts
- 867
Memcache is not an opcode cache system, it is based on distributed memory caching. I presume you are referring to PHP code and my personal recommendation will be APC with PHP as DSO module.
Also make sure that webserver/PHP and APC are tuned for handling such a high traffic.█ WebHostRepo.com
█ Linux | Windows | VPS | Cloud
█ Outsourced Technical Support since 2009
█ sales@webhostrepo.com
-
08-09-2012, 11:55 AM #3Temporarily Suspended
- Join Date
- Jul 2008
- Posts
- 273
Cache server is not what I want to cache and certain parts of the site, certain mysql query.
I want the best possible solution, which consumes fewer resources and is fast.
-
08-09-2012, 01:04 PM #4PING PONG
- Join Date
- May 2009
- Location
- SLASH ROOT
- Posts
- 867
As I mentioned earlier APC is non-distributed while memcache is distributed cache system. If you have multiple webservers for your website (load balanced), you need a distributed cache system (memcache).
If you have just 1 webserver go for APC as this is ~4 times faster than memcahe.█ WebHostRepo.com
█ Linux | Windows | VPS | Cloud
█ Outsourced Technical Support since 2009
█ sales@webhostrepo.com
-
08-09-2012, 04:34 PM #5Newbie
- Join Date
- Aug 2012
- Location
- Phoenix
- Posts
- 15
With 4k concurrent users, I would stray away from any file caching strategies where the cache resides as a file on the disk. Disk I/O will become a problem as you grow and if you service your users from multiple application servers, you would have to move to a storage server so your application servers all have access to the cache, which is pretty slow for cache retrieval - and your pipes will be limited.
Given your current load and if you expect it to grow, you will probably have to scale out to multiple application servers, which you would need memcache for anyway.
-
08-09-2012, 04:48 PM #6Temporarily Suspended
- Join Date
- Jul 2008
- Posts
- 273
-
08-09-2012, 05:02 PM #7Newbie
- Join Date
- Aug 2012
- Location
- Phoenix
- Posts
- 15
Yeah, if you wanted to implement a smarty caching strategy that utilizes memcache through their API, that would be a good result. Just stay away from the default file caching strategy.
I personally do not have experience with nginx, so I cannot say what the caveats are regarding it.
Personally, I use Apache, PHP, MySQL and Memcache to service 15,000 concurrent users in my environment having 10 application servers, each with a memcache instance and it performs wonderfully. Have plenty of headroom and I cache everything from database result sets to serialized PHP classes and objects from my DAL to compiled html segments.
-
08-09-2012, 06:03 PM #8Temporarily Suspended
- Join Date
- Jul 2008
- Posts
- 273
-
08-09-2012, 06:07 PM #9Newbie
- Join Date
- Aug 2012
- Location
- Phoenix
- Posts
- 15
No, I do not use the memcache plugin for mysql. I use it strictly in the PHP layer and do my own caching of mysql result sets, objects and etc.
I use my own technology. Code everything myself. Memcache is a native PHP extension, so adding a memcache layer into your PHP application is pretty easy.
-
08-09-2012, 06:16 PM #10Temporarily Suspended
- Join Date
- Jul 2008
- Posts
- 273
-
08-09-2012, 06:21 PM #11Newbie
- Join Date
- Aug 2012
- Location
- Phoenix
- Posts
- 15
I use memcache for both scenarios. I also use memcache for other types of data as well.
-
08-15-2012, 08:36 PM #12Newbie
- Join Date
- Mar 2010
- Posts
- 6
The quick and dirty: use smarty cache plugins to cache IN memcache.
Smarty can cache at several levels (cache php, cache evaluated php, etc), and you should cache the final html where possible.
If you must, cache your mysql arrays, but if they're heavily dynamic, you need to be more selective. There isn't a magic bullet, you should start at the most used queries that change the least (top 5 items on your store, front page, etc).
-
08-24-2012, 12:41 AM #13New Member
- Join Date
- Aug 2012
- Posts
- 3
A big music distribution site I worked for used memcache for the MVC web app.
-
08-30-2012, 06:31 PM #14Junior Guru Wannabe
- Join Date
- Aug 2012
- Location
- Houston, TX
- Posts
- 65
In my experience, the file cache is the fastest. I should clarify that I haven't done any serious performance tests, but in all the time I've used Smarty, I have found the file cache to work best.
-
08-30-2012, 07:14 PM #15Newbie
- Join Date
- Aug 2012
- Location
- Phoenix
- Posts
- 15
-
08-30-2012, 07:30 PM #16Web Hosting Master
- Join Date
- Jul 2007
- Location
- Virginia
- Posts
- 1,314
Use an in-memory key-value store. You will suffer from I/O issues if you choose to go with a disk-based cache.
~ @PreetamJinka
-
08-30-2012, 07:32 PM #17Junior Guru Wannabe
- Join Date
- Aug 2012
- Location
- Houston, TX
- Posts
- 65
You're right, I should had clarify that is also not a stable solution for high traffic sites. File caching is best when you have a single server instance or using shared drive in a server cluster, but when you have a web server cluster (two or more web servers serving the same content), the problem with file based caching is not sync across the web servers. To perform a simple rsync on the caching directories is error prone. In the end, memcache might be a better solution.
█ RyStark - Superb Hosting Solutions
█ Shared Hosting | Dedicated Servers
-
08-30-2012, 08:09 PM #18Newbie
- Join Date
- Jun 2012
- Posts
- 9
Memcached is the only real option here.
-
09-03-2012, 11:25 AM #19Newbie
- Join Date
- Feb 2012
- Posts
- 6
most time cache performance is trade off by dynamic content visiting . if you site get much more query request than updating request then there is an solution for more high performance called cache forecast .
-
09-08-2012, 10:35 PM #20Newbie
- Join Date
- Jul 2012
- Posts
- 8
How reliable is Memcached? I thought I remember it having reliability problems at some point in the past.
-
09-09-2012, 03:31 AM #21Web Hosting Evangelist
- Join Date
- Nov 2009
- Location
- Riga, Latvia
- Posts
- 473
Consider using nginx as a proxy webserver instead.
SERVERIA.COM: top secret servers Fully managed confidential dedicated Linux & Windows servers.
SERVERADE.NET: server management PROs Request a quote for your server now!
SECRETGSM.COM: anonymous SIM cards Anonymous prepaid calling cards & more.
Similar Threads
-
AMD Opteron 6134 Magny-Cours 2.3GHz 8 x 512KB L2 Cache 12MB L3 Cache Socket G34 115W
By CrocWeb Cloud in forum Web Hosting HardwareReplies: 0Last Post: 04-08-2012, 10:31 PM -
Best Cache Solution?
By investorz in forum Web HostingReplies: 20Last Post: 02-22-2012, 01:41 PM -
7,200RPM with 32MB Cache or 10,000RPM with 16MB Cache
By xmutan in forum Dedicated ServerReplies: 20Last Post: 08-13-2009, 05:43 PM -
mod_cache does not cache the homepage but the rest is cached. Any solution?
By EnAlgures in forum Hosting Security and TechnologyReplies: 0Last Post: 03-23-2009, 03:03 PM -
how faster is a P4 2.8G with 1M Cache than the one with 512K cache?
By surfmanjoe in forum Dedicated ServerReplies: 3Last Post: 03-28-2005, 05:05 PM