Php client crashed my server


I’m using aerospike to cache html pages on a busy server, everything was working fine for around 3 hours and then things started to go wrong the CPU load shot up and the server crashed (rebooted) I kept the client running for an hour or so afterwards but the server kept timing out and the CPU load was high.

as soon as I stopped using the client the CPU load came down and the server was stable again.

I think the problem was that every time the page was loaded I was creating the client:

$config = [“hosts” => [[“addr”=>“”, “port”=>3000]], “shm”=>[]]; $client = new Aerospike($config, true);

is creating the client each time the right thing to do? will the client be destroyed after the page has finished loading?

I think the client would work better if it was a simple API PUT, GET curl call like elasticsearch

the server side remained very stable

I have just one node, the client posted about 85,000 objects in 3 hours (around 3 gb)

the client was running on a 24 core, 64gb ram server

Hey Stu,

First, in a webserver context you need to use both persistent connections and shared-memory cluster tending. You seem to be doing so, which is good.

People are already using the PHP client in large production deployments, and it performs well. If you still have a problem please let us know the version of the server you’re using, the client version, the OS. How many server nodes (and info about them - DRAM, disk, cores). It would also be good to have the aerospike.conf on the server nodes, and the config you’re using for PHP on the webserver (FPM config, for example). Specifically, how many processes do you have on those 24 core servers? How many webserver instances do you have?

We have seen issues at the kernel level before that were affecting PHP processes running behind FPM that really had nothing to do with Aerospike, but would affect any long running PHP process. They looked like PHP processes that are frozen and taking 100% of the core without doing anything. Those emerged because we suggest that people configure their apps to accept as many requests as possible.

If there’s a bug, let’s identify it and open one in the aerospike/aerospike-client-php repo on GitHub.

© 2015 Copyright Aerospike, Inc. | All rights reserved. Creators of the Aerospike Database.