 | News Feed |
 | Jobs Feed |
Sections
|
| feed this: |  |
PHP-HTML.net: Creating a Simple PHP Cache Script
by Chris Cornutt March 03, 2010 @ 12:40:28
On the PHP-HTML.net site today there's a new tutorial about creating something that could give your site a pretty big performance boost - a simple method for caching your data.
Cache is a programming concept that can be used in a various range of applications and for various purposes. A cache library can be used for storing database queries for later use, to store rendered pages to be served again without generating them again, or to save indexed pages in a crawler application to be processed by multiple modules.
They include the code to create a very basic filesystem-based caching system for any kind of data you need. It sets expiration times and stores each bit of information in its own cache file to avoid overlap on read/write. This is a pretty simple example of data caching, but it gives you an idea of something that can help speed up your application. If you need something with a little more power, you might check out memcached.
voice your opinion now!
cache tutorial filesystem memcached
ProDevTips.com: Memcached in PHP on Dapper
by Chris Cornutt February 09, 2010 @ 08:32:16
New on the ProDevTips.com blog there's an article talking about the use of memcached on Dapper to increase the overall performance of the site.
Memcached is a very simple thing at heart; a daemon that runs in the background and that can be called from your code to store a value with the help of a key, and then retrieve said value with the help of the key used to store it; and it all happens in the RAM.
He talks briefly about the installation of the memcached server (on Ubuntu, in his case) via the source including a little trick he needed to do to get it to work correctly with the ld.so.conf file. He also includes the code for a simple class to implement it in your application.
voice your opinion now!
memcached cache performance tutorial
Abhinav Singh's Blog: MEMQ Fast queue implementation using Memcached and PHP only
by Chris Cornutt February 08, 2010 @ 09:03:12
Abhinav Singh has a new post to his blog that looks at using a powerful tool, memcached, with PHP to create a simple queue system that could be reused just about anywhere.
Memcached is a scalable caching solution developed by Danga interactive. One can do a lot of cool things using memcached including spam control, online-offline detection of users, building scalable web services. In this post, I will demonstrate and explain how to implement fast scalable queues in PHP.
He starts with an overview of what the queue will let you do - save data into the queue with a unique identifier and pull it back out based on the key requested (and is removed from the queue). The code sets up the connection to the memcached server and gives you methods to check if the queue is empty and to push and pull records in and out. A bit of sample code illustrates how to put it to use.
voice your opinion now!
memcached queue tutorial
Wb Developer Juice: 10 baby steps to install Memcached Server and access it with PHP
by Chris Cornutt January 27, 2010 @ 10:03:07
New from the Web Developer Juice blog there's a tutorial looking to help you get a memcached server up and running and make it accessible to your PHP applications.
Thinking of implementing caching for your php application , you are at a right place. Just in 10 simple (copy and paste) steps you can install and access Memcached Server.
Their steps use the yum package manager, but several other linux distributions with other packaging systems will probably have similarly-named packages. Since the install process requires loading system libraries and being able to restart the web server, you might needs to have a privileged account to make the installation work. It's a pretty simple process though - install the lib, install memcached, start up the server and test your PHP installation to be sure a sample script can reach it.
voice your opinion now!
memcached server tutorial install
Abhinav Singh's Blog: Wordpress style "Duplicate comment detected" using Memcached and PHP
by Chris Cornutt January 02, 2010 @ 07:36:27
Abhinav Singh has a new post today looking at his method for preventing duplicate comments (similar to a method used on Wordpress blogs) using memcached.
In this blog post, I will put up some sample PHP code for Duplicate comment detection using Memcached without touching the databases. Towards the end, I will also discuss how the script can be modified for usage in any environment including forums and social networking websites.
His method uses a custom function (is_repetitive_comment) to create an md5 hash of the comment and username to check against the stored values on the memcached server. Code is included as is an explaination of how it all works together.
voice your opinion now!
memcached duplicate comment wordpress
Abhinav Singh's Blog: How to use locks for assuring atomic operation in Memcached?
by Chris Cornutt December 09, 2009 @ 11:20:42
In a new post to his blog Abhinav Singh shows you how to create a simple application that uses the memcached atomic increment command to help prevent concurrency issues.
Memcached provide atomic increment and decrement commands to manipulate integer (key,value) pairs. However special care should be taken to ensure application performance and possible race conditions while using memcached. In this blog post, I will first build a facebook style "like" application using atomic increment command of memcached. Also, I will discuss various technical difficulty one would face while ensuring atomicity in this application. Finally, I will demo how to ensure atomicity over a requested process using custom locks in memcached.
Example code is included to show how you can take a normal "store to memcached" example and modify it with the increment method to resolve issues that might come up from one or more scripts trying to get at the same values. He also includes an example of using locking to provide a similar effect.
voice your opinion now!
memcached atomic operation tutorial
Hasin Hayder's Blog: Using new PECL Memcached extension for storing session data
by Chris Cornutt October 19, 2009 @ 09:51:21
Hasin Hayder has a new post talking about the new memcached extension for PHP (memcached from PECL) and how it can be used to store sessions data.
Many of you already know that managing session is a critical task for web applications, specially when you want to avoid I/O hop and also a significant load over your database by writing a custom session handler. [...] This is why a central session manager is very important for your application to scale.
He walks you through the whole process - installation, setting up memcached instances and getting the extension installed and working with your PHP installation. By adding two lines to your php.ini file, the sessions can quickly and easily be stored in memcache instead of on the local server.
voice your opinion now!
session data save memcached pecl extension
Paul Reinheimer's Blog: Storing Sessions in Memcache (how everything behaves)
by Chris Cornutt July 13, 2009 @ 15:10:14
In this new post to his blog Paul Reinheimer looks at one of the more powerful tools at a PHP developer's disposal - memcache - and how you can use it to store sessions.
I've been using memcached to store session data for the past while, but we ran into a few problems at work that led me to dive in a bit deeper and see how PHP, Sessions, and memcached play along. [...] When you start up a session a new entry is created in memcache, the expiry is the same as session.gc_maxlifetime. Session data is retrieved each time a session is started (either with session_start(), or if you have session.auto_start enabled, etc).
In his "long version" he explains what's actually happening behind the scenes between PHP's session handler and the memcached server.
voice your opinion now!
memcached handler session memcache
Andrei Zmievski's Blog: pecl/memcached turns 1
by Chris Cornutt July 08, 2009 @ 09:14:17
Andrei Zmievski has announced the release of the first stable version (1.0.0) of the memcached extension for PHP.
It's been stable for a while actually, but some people were hesitant to use it in production while it still had the beta designation. Well, no more, go forth and use it.
Future plans include the addition of memcached_dump and auto-ejection support. The memcached extension is a PHP library that allows your application to interface directly with a memcached server. Memcached is a high-performance, distributed memory object caching system, generic in nature, but intended for use in speeding up dynamic web applications by alleviating database load.
voice your opinion now!
stable extension memcached pecl
Ibuildings techPortal: New Memcached Extension for PHP
by Chris Cornutt June 22, 2009 @ 10:27:51
The Ibuildings techPortal website has posted a new article from Lorna Mitchell looking at the new and improved memcached extension (as most recently updated by Andrei Zmievski).
The idea behind the new extension is to leverage the functionality contained libmemcached - a solution which has been widely adopted across many scripting communities and beyond. The extension is available in PECL and has lots of shiny new functionality. This article looks at how to obtain and work with the new extension, and also shows off a couple of the new features it includes.
Lorna talks a bit about the features of the extension in general but mentions two great new ones specifically - the "getmulti" fetch method allows for grabbing multiple chunks of cached information and the cas (compare and swap) function that works the same as a replace but checks the current contents first.
voice your opinion now!
cas getmultii extension memcached
|
Community Events
Don't see your event here? Let us know!
|