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

Niklas Keller:
The Magic Behind Async PHP
Nov 07, 2017 @ 16:27:51

Niklas Keller has a post to his site covering the magic behind async PHP and how it can help your application gain some performance by working around the typical PHP execution flow.

Async PHP allows a massive speedup of applications by leveraging non-blocking I/O. It allows making multiple HTTP requests in parallel or any other way of I/O multiplexing. But what’s the magic behind it? How does it actually work?

He starts with a brief explanation of the difference between blocking and non-blocking I/O, pointing out that the main difference is the use of streams. He includes a bit of code to help illustrate but moves quickly on to talking about the Amp PHP package. This library allows for easier (and faster) development of non-blocking processes using an event loop. He also shares a package that was created to help make it even simpler by providing an abstraction layer on top of the Input and Output streams.

tagged: async language amp library blocking nonblocking introduction

Link: https://blog.kelunik.com/2017/11/06/magic-behind-async-php.html

Tom Rawcliffe's Blog:
session_start() blocking in php
May 25, 2011 @ 15:46:21

Tom Rawcliffe has a new post to his blog talking about an issue he found when trying to optimize a site for his company's systems - a problem with the blocking sessions caused when the pages were loaded.

Now I didn’t know it but is seems that php’s session handling is blocking on a per request basis. Kinda makes sense if you think about it, that if two requests simultaneously try and change a session variable then you would get constancy issues. So php handles this by making session_start() a blocking action and will wait for any other request to either finish or close the session using session_write_close().

The only reliable fix he found for the issue was to only selectively use the session in certain circumstances (or on certain pages) and closing it out when you were done with it.

tagged: sessionstart blocking page load issue

Link:


Trending Topics: