Answer the question
In order to leave comments, you need to log in
How to speed up Apache: serving static files and executing PHP?
Will switching to FastCGI with mod_php help?
And here's the question.
There is a site that used to be hosted, we are switching to VPS and the task is to make it at least not slower than it was.
On VPS, even more powerful hardware is Intel Xeon 3.4 GHz, versus 2.2 on hosting.
Cores - there are 4 and the load limit is 25%, here 3 and there is no limit, these are our cores)
Disk - SSD.
OS is Ubuntu.
PHP - there is 7.0.7 and we seem to have it too.
But alas, it works much slower, it takes a lot of time from the beginning of the response to its end, on all requests, including the main GET html.
And it would be fine only pages, but even a simple text / plain file on the hosting is given 3 times faster, although this is the first request, and not Not Modified.
Or rather, hosting is unstable, sometimes faster, sometimes slower, but it's better than the stable slowness of VPS.
I studied the entire httpd.conf, dug up a bunch of guides on highload (they are old and with dubious advice like "disable unnecessary modules", although on the hosting, judging by the list of modules in the admin, they obviously did not do this, as well as advice on a bunch of parameters in httpd.conf, which I twirled this way and that), tried pagespeed.
Nothing helped, pagespeed actually didn't help much even for pages (well, it shouldn't help for txt), although the page looks cooler in Code View.
Well, well, the success of hosting with statics is explained by CDN or some other cache.
You can also drag the Internet channel here.
But here's another experiment: we insert a more time-consuming PHP code into the file (without adding a single byte to the response weight) - and the hosting immediately goes into the gap by 10 times.
Obviously, the problem is not in the absence of a CDN and not in the Internet channel, memcached is not here will help, the problem is in the speed of the Apache + PHP bundle.
Questions:
1) Is the so-called "powerful" processor slower for all VPSs than for some miserable hosting, albeit with a VIP tariff?
2) Will FastCGI help in this situation?
3) Why are chips like eAccelerator (AST caching, etc.) not popular?
I know that many of them are abandoned, but this is not a cause, but a consequence.
4) What else can help?
Answer the question
In order to leave comments, you need to log in
Studied the whole httpd.conf, dug up a bunch of guides on highload (they are old and with dubious advice like "disable unnecessary modules"One of the first modules that should be disabled in Apache, for speed, is support for .htaccess files, this performance support itself does not add, and the presence of these files is even more so.
1) Is the so-called "powerful" processor slower for all VPSs than on some miserable hosting, albeit with a VIP tariff?No, maybe you, personally, have some kind of crappy VPS hoster, or even worse, a tariff like "OpenVZ, we don't resell the sold resources... well, maybe 10 times, but we don't resell anymore"
2) Will FastCGI help in this situation?FastCGI is a PHP mode of operation, it does not directly affect performance to a large extent, moreover, the FCGI operation logic itself (if we compare Apache-FCGI and Apache-mod_php) will be slower, because a socket will be used for FastCGI interaction (" normal" or unix socket), which implies network communication, instead of the direct operation of the PHP interpreter "inside" the server. I think a little something else will help you (I will try to describe below).
3) Why are chips like eAccelerator (AST caching, etc.) not popular?I have no idea why they are not popular and where you get such statistics from ... But perhaps the fact is that eAccelerator is morally and physically outdated, and if you believe, for example, such a banal article (no, I do not work with such a " masterpiece" CMS like "Bitrix", it's just the first mention of eAccelerator that came to my mind) - it does not work with PHP versions higher than 5.3.
I know that many of them are abandoned, but this is not a cause, but a consequence.I cannot comment on this, since you did not indicate the consequence - what exactly. In other words, I don't quite understand what you mean by that.
4) What else can help?Well, right off the bat, from memory (options may not be related to each other):
nginx for serving statics, and as a frontend before apache. You can also completely abandon Apache in favor of nginx + php-fpm.
If you need a CDN, try Cloudflare, at least for some of the resources.
on a cheap VPS I have a slaughtered one core per 1000 gigahertz, on hosting I have 8 cores at 3.9 gigahertz, as they say the difference is in the face
there is no php mod the fastest option for php
they are super popular but in new versions of php there is already a built-in zend op cache their replacement and they just died
nginx ?
You made the typical mistake of buying a xeon and you think that it will work just as fast depending on its cost.
And so you need
a skylike with a maximum frequency, dada - your "uh iron" will overtake the usual core i3, not to mention the normal i7
Renting it will be cheaper, buying it too, and the performance will be much better.
And the reason here is in the clock frequency, the Apache poorly parallels the processes, and even paralleling them, it still performs a hit on 1 process. As a result, the speed of your xeonao in 2Ghz is your peak speed and 30 cores do not solve anything here, an ordinary office computer will do it.
All you get from this hardware is a large number of parallel requests, at the same speed.
But as you understand, what you need is not 10-50 thousand people a day, it’s quite enough for yourself to pull 1 percent of I7
, in fact, without consulting, you bought or rented complete rubbish that is not suitable for web applications. Particularly for websites.
yes, you can host on this hardware, and some things will also work better on it, but the average hit will fall into a hard toilet.
Recommend.
Remove didikate, so it's not so difficult.
hetzner options
- germany excellent rates, we take only ssd and only skylike pints 50
https://chipcore.com/ - peter, ping 5-10 any of the rates will be more cheerful.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question