Measuring nginx's efficiency
Lucas Rolff
lucas at lucasrolff.com
Thu Jun 29 19:02:32 UTC 2017
> Well, this php-engine is built into apache itself
Just because apache do have a built in PHP handler such as mod_dso doesn't mean it's actually used to serve static files ( I can tell you that the php engine is never hit if you serve static files)
> Anyway, considering only this fact, such a bad apache configuration should not be significantly slower than that of nginx?
> Which ones?
Things like avoiding .htaccess, using mpm_event instead of prefork or worker, will both increase performance and decrease memory usage
> And how exactly can I measure this?
Benchmark
Change config
.... Repeat
> Right now we have a pretty capable dedicated server which costs ca. 40Euro per month and is an overkill for our needs.
True - but it's good to know what your stack is capable of doing in case of capacity planning, and to see whenever you should scale up your infrastructure - personally I optimize my environments even if I have plenty of resources, because I like being able to handle unexpected spikes in traffic
> Do you think I should stress a production server?
It's not up to me, or anyone else to decide - we do not know how your application works, and what it does - some people might be able to benchmark a server in product, others might not - it's a case by case thing in my opinion.
Just be aware of the consequences by benchmarking/stress testing, such as increased server load, increased response times and possible downtime in case you push it too hard.
I've personally done it plenty of times, but I do it in a controlled way and I'm fully aware of what can possibly go wrong.
Best Regards,
On 29/06/2017, 20.47, "nginx on behalf of ST" <nginx-bounces at nginx.org on behalf of smntov at gmail.com> wrote:
>> If your current apache configuration serves static files via the php engine, then you're doing something very wrong.
>Well, this php-engine is built into apache itself... Anyway, considering only this fact, such a bad apache
>configuration should not be significantly slower than that of nginx?
>
>> You might or might not see any speed gain depending on your apache configuration, but you should see a big difference in the amount of resources used to serve traffic.
>Which ones? And how exactly can I measure this? This also might be a
>good point to convince my boss to switch...
>
>> As Valentin mentioned, it's about scalability majority of the time - and that in itself will decrease your costs in hardware or resources that is required to be able to serve your static traffic, and I'm sure whomever you have to prove to, why you should switch from Apache to nginx, would love to see that the cost of running your current setup might decrease to some or to huge extend.
>Right now we have a pretty capable dedicated server which costs ca.
>40Euro per month and is an overkill for our needs. So for now resources
>is not an issue that much...
>
>>
>> If you run wrk as suggested below, you will get a bunch of useful data that will help you chose whichever software solution is the best to use.
>
>Do you think I should stress a production server?
>
>Thank you!
>
>
>>
>>
>>
>> On 29/06/2017, 19.38, "nginx on behalf of ST" <nginx-bounces at nginx.org on behalf of smntov at gmail.com> wrote:
>>
>> >On Thu, 2017-06-29 at 16:16 +0300, Valentin V. Bartenev wrote:
>> >> On Thursday 29 June 2017 15:32:21 ST wrote:
>> >> > On Thu, 2017-06-29 at 15:09 +0300, Valentin V. Bartenev wrote:
>> >> > > On Thursday 29 June 2017 14:00:37 ST wrote:
>> >> > > > Hello,
>> >> > > >
>> >> > > > with your help I managed to configure nginx and our website now can be
>> >> > > > accessed both - through apache and nginx.
>> >> > > >
>> >> > > > Now, how can I prove to my boss that nginx is more efficient than apache
>> >> > > > to switch to it? How do I measure its performance and compare it to that
>> >> > > > of apache? Which tools would you recommend?
>> >> > > >
>> >> > > > Thank you in advance!
>> >> > > >
>> >> > >
>> >> > > I suggest wrk.
>> >> > >
>> >> > > https://github.com/wg/wrk
>> >> > >
>> >> >
>> >> > Should I stress our production system with this tool? Our system blocks
>> >> > users that make to many requests in a given amount of time...
>> >> > Also, how do I prove that static content is now served faster?
>> >> >
>> >> > Thank you.
>> >> >
>> >>
>> >> Switching from Apache to nginx usually isn't about speed, but about scalability.
>> >> It's all about how many users/connections you can serve from the same hardware.
>> >>
>> >
>> >Shouldn't it be also about speed, at least for static content, that no
>> >longer needs to be served through php-engine? And thus overall loading
>> >speed should be higher?
>> >
>> >_______________________________________________
>> >nginx mailing list
>> >nginx at nginx.org
>> >http://mailman.nginx.org/mailman/listinfo/nginx
>> _______________________________________________
>> nginx mailing list
>> nginx at nginx.org
>> http://mailman.nginx.org/mailman/listinfo/nginx
>
>_______________________________________________
>nginx mailing list
>nginx at nginx.org
>http://mailman.nginx.org/mailman/listinfo/nginx
More information about the nginx
mailing list