In my Ubuntu's System Monitor i am getting 17 processes for PHP.
They are getting a big part of my cpu and memory.
Some labelled "php" and others "php7.1".
Is this normal to happen? If not what is the suggested solution?
System: Ubuntu 14.04, Apache 2.4.7 with php 7.1 as a module.
Depends on how you integrate PHP in your webserver environment.
When 20 requests are handled, which performs PHP stuff, 20 times PHP is executed.
The amount of PHP processes should not be a problem. More interesting is, which PHP application needs much cpu and memory.
Related
I run a Mac OS X Server Yosemite with 6 virtual hosts.
Pretty normal Wordpress stuff, nothing very special.
For 2 days now, when I start the server, the CPU usage goes up to 750% immediately (I have an Intel Quad-Core) and the pages are very slow, sometime I even get a "MySQL too many connections" error.
My machine is a Mac mini quad core 2.3 Ghz with 16 GB of Ram.
I had the server running for 3 months without any similar problems.
Do you think it's an DDOS attack?
Thx,
Matthias
I found the reason. It was a ddos attack at my wordpress site. A bot was trying to brute-force the xmlrpc.php file in the root folder of my wordpress installation, guessing usernames and passwords via mysql.
I simply added
// in xmlrpc.php
<?php exit; ?>
at the beginning of xmlrpc.php, and now there is peace on earth again.
We are programming an embedded system on debian linux in python 2.7. We need an on-board web server and since I'm fairly new to this environment, I'm confused by all the options and would like some advice. Our main application is in python and when a user accesses the web server they will need to see and modify information that is contained inside that main app. Should I be using mod_python, cgi, mod_wsgi, or something else? How do I get the Apache python instance to communicate with the main instance?
What is the best way to do this and where can I find setup help?
If you want to be using Apache and Python i'd suggest you'd use the python microframework Flask
Apache seems a bit heavy to use for an embedded device, i'd suggest something like Lighttpd or Nginx, not as resource hungry as Apache.
But if you want something that's easy to set up i'd stick with Apache & Flask over mod_wsgi, as flask is 100% WSGI 1.0 compliant.
We're experiencing a strange problem with our current Varnish configuration.
4x Web Servers (IIS 6.5 on Windows 2003 Server, each installed on a Intel(R) Xeon(R) CPU E5450 # 3.00GHz Quad Core, 4GB RAM)
3x Varnish Servers (varnish-3.0.3 revision 9e6a70f on Ubuntu 12.04.2 LTS - 64 bit/precise, Kernel Linux 3.2.0-29-generic, each installed on a Intel(R) Xeon(R) CPU E5450 # 3.00GHz Quad Core, 4GB RAM)
The 3 Varnish Servers have a pretty much standard, vanilla cfg: the only thing we changed was the vcl_recv and vcl_fetch in order to handle the session cookies. They are currently configured to use in-memory cache, but we already tried switching to HDD cache using an high-performance Raid Drive with the same exact results.
We had put this in place almost two years ago without problems on our old web farm, and everything worked like a blast. Now, using the machines described above and after a clean reinstall, our customers are experiencing a lot of connection problems (pending request on clients, 404 errors, missing files, etc.) when our websites are under heavy traffic. From the console log we can clearly see that these issues start happening when each Varnish reaches roughly 700 request per seconds: it just seems like they can't handle anything more. We can easily reproduce the critical scenario at any tme by shutting down one or two Varnish Servers, and see how the others react: they always start to skip beats everytime the req per seconds count reaches 700. Considering what we've experienced in the past, and looking to the Varnish specs, this doesn't seem to be normal at all.
We're trying to improve our Varnish servers performances and/or understand where the problem actually is: in order to do that, we could really use some kind of "benchmark" from other companies who are using it in a similar fashion in order to help us understand how far we are from the expected performances (I assume we are).
EDIT (added CFG files):
This is our default.vcl file.
This is the output of varnishadm >param.show output console cmd.
I'll also try to post a small part of our varnishlog file.
Thanks in advance,
To answer the question in the headline: A single Varnish server with the specifications you describe should easily serve 20k+ requests/sec with no other tuning than increasing the number of threads.
You don't give enough information (vcl, varnishlog) to answer your remaining questions.
My guess would be that you somehow end up serialising the backend requests. Check out your hit_for_pass objects and make sure they have a valid TTL set. (120s is fine)
I have a Windows 7 Enterprice 64 bit and with 8GB RAM and I run a localhost with PHP, Apache and MySQL. However, Apache is (officially) still in 32-bit binary. And my system is performing at a enormously low speed... Is this a common problem or are there any tips or trics to boost my performance?
tl;dr version: It is not the 32-bit Apache that is slowing it down.
We would need more information to determine the cause of the problem but my guess is that it isn't the fact Apache is 32bit and Windows is 64bit.
The main difference between 32 and 64bit applications is that 64bit applications can access more memory directly (normally over about 3.5GB).
Apache itself is not particularly slow, it is all the modules you load with it (PHP, Python, mod_rewrite, etc).
It is most likely one (or more) of the following:
High Requests/sec - you have a high number of requests per second
High Processing Overhead - programs/scripts are using a lot of memory/CPU
Poorly Written Programs/Scripts - programs/scripts are inefficient or leaking memory
Other Processes - other programs on your PC (including Windows itself) may be using up your memory/CPU such as MySQL
Apache 64bit builds do not generally outperform the 32bit builds by more than 5%.
The only time I've seen a major slowdown running Apache on Windows was due to anti-virus software running.
How do you compare Nginx and Cherokee in terms of memory usage and performance? My VPS serves Drupal 6.16, magento 1.4.1 and CS-CART 2.0.15 with apache2 prefork-mpm. Apache2 eats my memory even though my sites are pretty low traffic profile (htop shows that each apache process eats %18 memory) . If I change apache to nginx or cherokee will I face any compatibility issues with magento, cs-cart and drupal? Which one is the most compatible with? I reallly appreciate any production system experience.Thanks.
You can greatly reduce the memory consumption of your VPS by installing a PHP accelerator such a eAccelerator. In most cases Apache web server will perform just fine. You might need to tweak it to optimize for your specific set up. You need to do some reading up on that though, since there is no silver bullet when it comes to that.
Try Hiawatha: http://www.hiawatha-webserver.org/. Its UrlToolkit is far more advanced than Apache's mod_rewrite. Yes, the frameworks you mentioned will run fine with Hiawatha. Tested it myself.
Take a look at the post below for some memory related measurements for Apache, Cherokee and Nginx. You might google around for similar results. However, I would recommend running such tests with typical cases in mind to see how it fits your use case.
Benchmark of django deployment techniques