Infomani

Hi, this is for U only.Do well, Feel Free…

  • No of Hits

    • 6,967 hits
  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 8 other followers

  • Time is Now

    August 2012
    M T W T F S S
    « Jun   Oct »
     12345
    6789101112
    13141516171819
    20212223242526
    2728293031  
  • Zip

  • Advertisements
  • My Recent Tweets

    • @AbhiKarthick To keep poster only... There is no doubt in that. 1 day ago
    • RT @KaruNeelamMedia: போராடிப் பெற்ற 1500 கோடி எய்ம்ஸ் மருத்துவமனை போராடாமல் பெற்ற 10000 கோடி எட்டு வழிச்சாலை யாருக்குப் பயன் ? | #கருநீலம்… 1 month ago
    • RT @jigneshmevani80: The Dr. Kafeel who saved children when Yogi Aadityanath gov had no money to pay for oxygen. He was put behind bars. No… 2 months ago
    • RT @PTTVOnlineNews: விவாத நிகழ்ச்சிகளுக்கெல்லாம் வழக்குப்பதிவு செய்வதாக இருந்தால் இந்தியாவில் பல தொலைக்காட்சிகள் மீதும் நாளொன்றுக்கு பல நூ… 2 months ago
    • RT @GunasekaranMu: தமிழகத்தில் நீட் எழுதியோர் 1.14 லட்சம். தனியார் மையங்களில் கட்டணம் ஒரு லட்சம் வரை! ரூ.2 லட்சம் செலவிட்ட பெற்றோர்களும் உ… 2 months ago
    • RT @vikatan: நீட் தேர்வில் தோல்வியடைந்ததால் விழுப்புரத்தைச் சேர்ந்த மாணவி பிரதீபா என்பவர் தற்கொலை செய்துகொண்டார். இந்தச் சம்பவம் பெரும் அதி… 2 months ago
    • RT @PTTVOnlineNews: மருத்துவமே படிப்பேன் என இலட்சியம் கொண்ட பிரதீபா - உயிரை மாய்த்துக் கொண்ட பரிதாபம் goo.gl/uDrNxe 2 months ago
  • Blogs I Follow

Alternative PHP Cache

Posted by Manikandan.MS on August 3, 2012


             This article describes about Alternative PHP Cache(APC). In PHP scripting program there are basically two kinds of caching technique one is opcode cache and next one is data cache. The APC is the opcode cache which can significantly speed up your applications. It caches both user variables and php code so that it minimize overall server load and memory usage.

The following points will explains about APC in detail. Suppose a site has thousands of requests per minute then we want to speed up the things to response given. So that the APC comes. Actually it is a free, open and robust framework for caching and optimizing PHP intermediate code. Simply APC caches the compiled output of each php script and reuse it for subsequent requests.

How it speed up the applications? Actually it uses shared memory for read/write operations. That means it stores the opcode into shared memory then copies opcode into execution process. Classes and functions tables are also stored into shared memory. APC alos provides a user cache for storing application data.

Next parameter will explains execution of APC. Simply, it checks the required data in already exists cache. If it doesn’t, it should be generated from the original data source and a copy saved to cache for future use. If it does, it can use it from the cache directly. There are predefined methods available for developers to store and fetching data in apc cache. APC allows you to cache arrays, objects, functions and references.

Configuration is the main points in APC. There are some procedures need to follow to configure . It takes time to configure and must be re-configured whenever php script added. There are two primary decisions to be made while configuring. First, ensure how much memory is going to be allocated to APC and second, whether APC will check if a file has been modified for every request. Once the server is running the apc.php script is bundled and copied somewhere into root directory and viewed with a browser. If the cache capacity reached maximum it has to forcefully clean. Data capacity should be minimized in a well configured cache. The easiest way to minimize the capacity allocate more memory to APC. In default It use 32Mb. So use APC for caches which sites are do not change often and will not grow large.

When APC is build with Memory Mapping, it will use only one memory segment, unlike when APC is build with SHM(SysV Shared Memory), it will support multiple memory segment. But I don’t know much about SHM. A well configured APC will absolutely speed up the application. Use Apc caching module depends on project requirements which are not change often and will not grow large.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

 
Pradeep

Why We live

TechView Mani

A blog of New Technologies

Infomani

Hi, this is for U only.Do well, Feel Free...

%d bloggers like this: