Multiple memcache instances/servers on windows
May 11th, 2009 • memcache, memcached, php, windows • 4 comments
Setting up memcache on windows is like taking candy from a baby. You can find all the information and the binaries for memcache at http://jehiah.cz/projects/memcached-win32/ . Note that these binaries will also work for x64 based windows.
A little trickier is to set up multiple instances of memcached on your windows machine. Basically you have to install the same memcache executable as many times as you want servers.
Installing memcache from the command line is simple:
sc create "Memcached11211" binPath= "E:\webserver\memcached.exe -d runservice -p 11211 -m 128" DisplayName= "Memcached11211" start= auto
Thus, for multiple instances this will be:
sc create "Memcached11211" binPath= "E:\webserver\memcached.exe -d runservice -p 11211 -m 15" DisplayName= "Memcached11211" start= auto
sc create "Memcached11212" binPath= "E:\webserver\memcached.exe -d runservice -p 11212 -m 15" DisplayName= "Memcached11212" start= auto
sc create "Memcached11213" binPath= "E:\webserver\memcached.exe -d runservice -p 11213 -m 15" DisplayName= "Memcached11213" start= auto
sc create "Memcached11214" binPath= "E:\webserver\memcached.exe -d runservice -p 11214 -m 15" DisplayName= "Memcached11214" start= auto
sc create "Memcached11215" binPath= "E:\webserver\memcached.exe -d runservice -p 11215 -m 15" DisplayName= "Memcached11215" start= auto
sc create "Memcached11216" binPath= "E:\webserver\memcached.exe -d runservice -p 11216 -m 15" DisplayName= "Memcached11216" start= auto
sc create "Memcached11217" binPath= "E:\webserver\memcached.exe -d runservice -p 11217 -m 15" DisplayName= "Memcached11217" start= auto
sc create "Memcached11218" binPath= "E:\webserver\memcached.exe -d runservice -p 11218 -m 15" DisplayName= "Memcached11218" start= auto
sc create "Memcached11219" binPath= "E:\webserver\memcached.exe -d runservice -p 11219 -m 15" DisplayName= "Memcached11219" start= auto
sc create "Memcached11220" binPath= "E:\webserver\memcached.exe -d runservice -p 11220 -m 15" DisplayName= "Memcached11220" start= auto
sc create "Memcached11221" binPath= "E:\webserver\memcached.exe -d runservice -p 11221 -m 15" DisplayName= "Memcached11221" start= auto
sc create "Memcached11222" binPath= "E:\webserver\memcached.exe -d runservice -p 11222 -m 15" DisplayName= "Memcached11222" start= auto
As you can see from the example above, you have to choose a different port for each memcache instance you are running.
memcache_connect() [function.memcache-connect]: Can’t connect to localhost:11211
May 11th, 2009 • memcache, memcached, php, snippets • 4 comments
Encountered this error? It could be as simple as switching the host from localhost to 127.0.0.1
before:
<?php
$memcache_obj = memcache_connect('localhost', 11211);
after:
<?php
$memcache_obj = memcache_connect('127.0.0.1', 11211);
Update! SQL database belgian postal codes + gps coordinates
March 7th, 2009 • Uncategorized • 1 comment
I’ve just updated my free database of all belgian postal codes and their gps coordinates! Most of the errors should handled in this version.
Let me know in a comment if there is any incorrect data.
http://www.rdlt.com/postcodes-van-alle-gemeentes-van-belgie-met-gps-coordinaten
Enjoy!
Update! Gratis lijst van alle Belgische steden/gemeenten met GPS coordinaten
March 7th, 2009 • free services, freebies, internet • 1 comment
Ik heb zojuist mijn GRATIS beschikbare database met lijst van alle Belgische steden/gemeenten met GPS coordinaten geüpdate. De meeste fouten zouden hier moeten zijn uitgehaald.
http://www.rdlt.com/postcodes-van-alle-gemeentes-van-belgie-met-gps-coordinaten
Moesten er toch nog fouten zijn ingeslopen, laat me dit dan weten in een reactie!
Alvast veel plezier ermee!
Moest je deze database ergens gebruiken, laat het me dan even weten!
Cache-Control: post-check, pre-check
March 3rd, 2009 • http, internet • No comments
An interesting resource about what those Cache Control headers actually mean! Sure made things a lot more clear for me!
Internet Explorer applies the following logic to objects served with these extensions:
- Upon first request, the object is cached and is served from cache until the
post-checkinterval expires.- Once the
post-checkinterval expires IE fetches the object from cache and checks for an updated one in the background. If a newer object is available it caches it. Upon every subsequent request this updated (and now cached) object is served until thepre-checkinterval expires.- Once the
pre-checkinterval elapses the object is treated as expired. IE will first ask the HTTP server if the object has changed since it was requested by the browser. If it has, IE will load the updated object.
read full article: http://aspnetresources.com/blog/cache_control_extensions.aspx

Recent Comments