New on LowEndTalk? Please Register and read our Community Rules.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
Comments
php-fpm
I noticed that /usr/bin/php-cgi eats a lot of ram, that's why...
It's probably because PHP encourages people to write crappy code.
Can php-Fpm be used in virtual environment such as webmin/virtualmin?
Nonsense!
@Damian here is some related fun
php-fpm plus ondemand scheduler n_n
"Seasoned pro"
OMFG!
And here is "Hello World" in a gazillion of different languages.
haha that's awesome. I was going to "Hello World" but it was too tiring
And here is some more
What? Register Globals is the BEST feature ever.
Thats too easy!
@debug: You win!
php-fpm for frontend
beanstalkd for backend tasks (resizing an image, etc)
https://phpbestpractices.wordpress.com/
did anybody actually use php-Fpm in virtual environment ?
Yes. It's using 15mb ram on my Xen VPS.
Apache mod_php uses 7 mb in openvz...
@LAKid mod_php doesn't scale as well.
That's like saying food encourages people to get fat.
I don't disagree that there are many bad PHP scripts, but there are many good ones as well.
Guys check out Mod_ruid2. its the perfect balance of security and speed. Either that or check out MPM-ITK
foreach ($userList as $user) {
$query = 'INSERT INTO users (first_name,last_name) VALUES("' . $user['first_name'] . '", "' . $user['last_name'] . '")';
mysql_query($query);
}
Source - lolz
@Derek
Good one, but sometimes you can't do that trickery without doing a loop
@Derek is it my idea or that's not security safe?
That PHP code just does (Amount of Users) x MySQL Query.
So if you have 25000 users, your running 25000 MySQL queries.
The Google recommendation basically recommends you put it into one query, but then the fact that you have to add it all into an array, then implode it. So if you have 25,000 users thats going to be slow anyway.
It also won't work with MySQL_insert_id.
Surely (firstname,lastname) values as a string.
Then for(;;)
$sql .= '(', $firstname ,',',lastname ,')';
would be better ? Also check for sql injection
Sorry on phone
I think the lowest memory usage is Apache mod_php (run as Apache's user).. I'm using it on my personal server.
But prefer using FCGId (run as virtual server owner) on share environment (share with other user).
Any other suggestion?
Thanks..
mod_php means every apache process has it's own php processor in it. That means every connection to apache needs at least 10-15mb ram. I often have 50-100 keepalive connections to my webserver. I would need almost 500mb-1GB ram for keepalives if I used mod_php.
PHP with uWSGI seems to be an interesting alternative, advertised to have better performance.