News Feed
Sections




News Archive
feed this:

Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Joe Watkins:
But, is it web scale ?
October 08, 2014 @ 11:16:05

In his most recent post Joe Watkins talks briefly about concurrency in PHP and some of the issues that can come along with it. This includes one of the most glaring: the stress it can put on the host system with even a small number of threads being introduced.

Before we start to cover the topic of how to achieve parallel concurrency in PHP, we should first think about when it is appropriate. You may hear veterans of programming say (and newbies parrot) things like: "Threading is not web scale." This is enough to write off parallelism as something we shouldn't do for our web applications, it seems obvious that there is simply no need to multi-thread the rendering of a template, the sending of email, or any other of the laborious tasks that a web application must carry out in order to be useful. But rarely do you see an explanation of why this is the case: Why shouldn't your blog be able to multi-thread a response ?

He gives an example of a controller request that spawns off just eight threads and imagines what might happen if that controller was requested even just one hundred times (resulting in 800 threads). He does point out at least one place where it could be useful, though: separating out the portions of the application that need to use the parallelism from the rest.

Parallelism is one of the most powerful tools in our toolbox, multicore and multiprocessor systems have changed computing forever. But with great power comes great responsibility; don't abuse it, remember the story of the controller that created 800 threads with a tiny amount of traffic, whatever you do, ensure this can never happen.
0 comments voice your opinion now!
webscale parallelism concurrency process threading

Link: http://blog.krakjoe.ninja/2014/10/but-is-it-web-scale.html

Jonathan Hill:
Video Multi-tasking in PHP (from Atlanta PHP)
December 28, 2012 @ 11:33:15

Jonathan Hill has posted the video of his recent presentation at the Atlanta PHP User Group, "Multi-tasking in PHP".

When it comes to multi-tasking and interacting with the operating system, PHP is no lightweight. In this December 6, 2012 presentation Jonathon Hill (@compwright) explores PHP's little-known POSIX, Process Control, and Semaphore extensions and shows you how to introduce a parallel dimension to your applications.

His presentation covers the use of multi-tasking to accomplish some common tasks in PHP (like batch processing or creating daemons). He talks about multi-processing vs multi-threading, forking, race conditions and semaphores.

You can watch the video of the presentation over on Vimeo and check out the software and links to other resources mentioned in the talk in this link bundle.

0 comments voice your opinion now!
video multitasking fork threading semaphore links


SitePoint PHP Blog:
The sysadmin view on "Why PHP"
January 12, 2006 @ 06:42:35

On the SitePoint PHP Blog today, Harry Fuecks takes a look at why PHP from a sysadmin's perspective.

A funny from the Python crowd: phpfilter'"PHP "support" under CherryPy. There is a serious side to that though'"it's spitting out something that looks like a PHP parse error'"i.e. this is a developer problem (e.g. someone ftp'd a PHP straight onto their live web server for 'útesting'Ě), not a runtime error.

More to the point, when was the last time you saw a PHP runtime error take down an entire application or web server? And no - "MySQL Connection Failed: Can't connect to local MySQL server" doesn't count'"PHP and the web server are still running'"the MySQL server (or otherwise) is to blame.

He also looks at a slightly different method for serving up web applications - with FastCGI. He talks about the basic features of a server (forking, threading, asynchronous I/O) and how that explains how we've ended up with PHP being the "lesser of the evils"...

1 comment voice your opinion now!
sysadmin view why use fastcgi threading forking asynchronous I/O sysadmin view why use fastcgi threading forking asynchronous I/O



Community Events





Don't see your event here?
Let us know!


podcast laravel introduction framework bugfix series deployment unittest voicesoftheelephpant release install symfony library zendserver interview package api language opinion community

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework