 | News Feed |
 | Jobs Feed |
Sections
|
| feed this: |  |
Dave Marshall's Blog: Defending against Cache Stampedes
by Chris Cornutt January 13, 2012 @ 13:13:08
Dave Marshall has a new post to his blog showing one method for defending against cache stampedes from assaulting your caching servers and (possibly) bringing them down.
I've recently had a problem with a rather large operation (that could probably be optimised considerably, but nevermind), where by if the cached result of the operation expired, several web server threads would attempt the operation, causing some major headaches for our database and web servers. This is something I've come across before, and is commonly(?) known as a Cache Stampede. This is bad, this post describes the basics of what I've done to deal with it.
His example uses a Zend_Cache interface to Memecache, but it could be applied in other places too. His method uses a binary semaphore to check and see if there's a "lock" and sleep for a bit before checking again. Sample code is included showing how to create this system and how to refresh the data with a new expiration on a cache miss.
voice your opinion now!
cache stampede zendcache tutorial binary semaphore miss prevention
PHP.net: PHP 5.4.0RC4 Released!
by Chris Cornutt December 28, 2011 @ 08:55:32
The latest version of PHP in the 5.4.0 release candidate series has been posted - PHP 5.4.0 RC4, complete with new features and lots of bugfixes.
The PHP development team is proud to announce the 4th release candidate of PHP 5.4. PHP 5.4 includes new language features and removes several legacy (deprecated) behaviours. Windows binaries can be downloaded from the Windows QA site. THIS IS A RELEASE CANDIDATE - DO NOT USE IT IN PRODUCTION! This is the 4th release candidate. The release candidate phase is intended as a period of bug fixing prior to the stable release. No new features should be included before the final version of PHP 5.4.0.
Updates in this release candidate include an update to the max_input_vars directive and a fix for a segfault in the traits code. You can find the full notes for the release in the NEWS file and can download the latest from the PHP.net site - source downloads, Windows binaries.
voice your opinion now!
release candidate windows binary news
PHP.net: PHP 5.4 beta2 released
by Chris Cornutt October 27, 2011 @ 10:12:59
The PHP.net site has a new announcement about the latest version of the language in the PHP 5.4.x series - beta 2 has been released for testing.
The PHP development team is proud to announce the second beta release of PHP 5.4. PHP 5.4 includes new language features and removes several legacy (deprecated) behaviours. Windows binaries can be downloaded from the Windows QA site. [...] Please help us to identify bugs by testing new features and looking for unintended backward compatibility breaks, so we can fix the problems and fully document intended changes before PHP 5.4.0 is released. Report findings to the QA mailing list and/or the PHP bug tracker.
Remember - this is not a production release, so do not use it in your live applications (unless you really like to live dangerously, of course). You can look at the NEWS file for a complete list of changes.
voice your opinion now!
beta release second windows binary qa bugtracker
Rob Allen's Blog: Some notes on SQL Server blobs with sqlsrv
by Chris Cornutt November 22, 2010 @ 11:15:33
In this new post to his blog, Rob Allen has posted notes on some of his experience in working with blobs with SQL Server using UTF-8.
This turned out to be easy enough: Use ntext, nvarchar types in the database and add resources.db.params.driver_options.CharacterSet = "UTF-8" to your application.ini
He also includes some code to fix a problem he spotted with storing binary data into a varbinary field giving him an error about string translation. The fix came in the way of replacing the direct file_get_contents assignment to a variable over to a binding method that specified the data type as well.
voice your opinion now!
sqlserver binary data insert datatype varbinary
Sameer Borate's Blog: Unpacking binary data in PHP
by Chris Cornutt September 22, 2010 @ 10:45:52
Sameer Borate has a new post to his blog today talking about a method for unpacking binary data directly in PHP - specifically in working with images.
To set the stage we will start with a programming problem, this will keep the discussion anchored to a relevant context. The problem is this : We want to write a function that takes a image file as an argument and tells us whether the file is a GIF image; irrelevant with whatever the extension the file may have. We are not to use any GD library functions.
He shows how to use the unpack function to open up the file and pull out the raw data - including the header information that tells you what kind of file it is you're working with. There's also an example of unpacking the header contents and grabbing things like height, width and the aspect of the image.
voice your opinion now!
unpack binary data tutorial gif image
Gonzalo Ayuso's Blog: Using CouchDb as filesystem with PHP
by Chris Cornutt September 01, 2010 @ 13:41:12
In a new post to his blog Gonzalo Ayuso shows an interesting use for the CouchDB tool - using it as a filesystem for cross-server handling of things like images or other binary resources.
One of the problems I need to solve in my clustered PHP applications is where to store files. When I say files I'm not speaking about source code. I'm speaking about additional data files, such as download-able pdfs, logs, etc. Those files must be on every node of the cluster. [...] CouchDb has two great features to meet or requirements with this problem. It allows us to store files as attachments and it also allows to perform a great and very easy multi-master replica system.
He shows how use two libraries he's created to connect to the CouchDB instance and, based on this structure, be able to insert the content - a text file in this case - pull it back out, get the meta data about it and even move it to another location in the structure.
voice your opinion now!
couchdb filesystem tutorial binary file
Kevin Schroeder's Blog: You want to do WHAT with PHP? Chapter 2
by Chris Cornutt August 27, 2010 @ 08:09:07
Kevin Schroeder has posted a new book excerpt from his "You Want to Do WHAT with PHP?" book - chapter two dealing with binary protocols.
PHP developers know text really, really well. We can write SQL, we can build HTML, we can work with XML. But computers don't speak in terms of structured text markup, they speak in terms of bytes. And while there are many PHP developers who can speak at the lower level of bytes and bits and such, there are many more that have difficulty there.
His short excerpt (from a very long chapter) talks about working with DNS information and how you can send requests (similar to the unix "host" command) and parse them correctly. Some sample code is provided to make a request for a record on mcpressonline.com and the output it would produce.
voice your opinion now!
book excerpt kevinschreoder binary dns request
Jeremy Cook's Blog: Handling Binary Data with PDO
by Chris Cornutt March 03, 2010 @ 14:48:56
Jeremy Cook has put together a quick guide for something that can be tricky when using PDO in PHP - handling binary data in the return from your queries.
I like the fact that if I needed to use MS SQL Server, Oracle or any of the other big RDBMS's I could use the same PDO syntax to access them rather than learning a new database access library. However, there do seem to be some bugs in PDO according to what I've read on the web. While I haven't encountered most of them and can't comment on them I'd like to write about one that I ran into the other day and how I worked around it.
He was storing images in the database and pushing the information into the database was working fine. When he tried to pull the contents back out, however, the information wasn't being handled correctly (according to the example in the PHP manual) because of a differing return value for the fetch call - sometimes it's a string but, in this case, it's binary data so it needs to just be passed on through.
voice your opinion now!
pdo database mysql binary data
PHPBuilder.com: Math & Number Handling in PHP - The ABCs of PHP Part 6
by Chris Cornutt April 22, 2009 @ 07:57:17
On PHPBuilder.com today they've posted the next article in their "ABCs of PHP" series. This time they focus on math and number handling.
Last time we looked at text and strings in variables, in this episode we're going to continue with our exploration of PHP variables and delve deeper into math and number handling in PHP. Using numbers is not much different to using text and strings, you allocate variables and fill them in, using exactly the same techniques as you do using strings & text.
They covers some of the basic operators (+,-,*,etc), evaluation with equals, number shifting, binary and creating a "barrel shifter" to work with the binary bits of a number.
voice your opinion now!
shifter barrel binary introduction abc handling number math
PHPBuilder.com: The ABC's of PHP II - What do I need to make it work?
by Chris Cornutt March 16, 2009 @ 07:58:31
Peter Shaw has posted the second part of his introductory series to PHP - "The ABCs of PHP". In this new article Peter looks at the installation and configuration of PHP on your platform of choice (Windows or Linux-based).
PHP runs on all the major computing platforms available today, this includes all versions of windows, all the major linux distro's and a lot of specialist systems for devices like the Cobalt Raq and a lot of embedded devices. In this article however we will be concentrating on running PHP under the Apache and IIS web servers, which between the two covers approx 95% of the systems most people will have access to.
He uses packages on the linux installation to make things simple (for a basic Apache2 and PHP5) and the PHP and Apache binaries from each project on the Windows platform.
voice your opinion now!
abc basic introduction language install apache php5 windows linux package binary
|
Community Events
Don't see your event here? Let us know!
|