Please I am a young programmer i need some help, I developed an Examination system with
cakephp and I want the students to write the exam offline using this application, I am using wampserver on
windows server 2012 r2, Hp laptop Core i7 with 1TB HDD Hard disk, 16GB RAM, 2.7Ghz cpu, my problem is when 200 and above candidates login and start exam Apache will use up my CPU and start kicking students away saying this site can’t be reach.
OMG! Are u serious those are your server specs? ok ok … anyway, probably is normal… (performance issues)… but please provide more informations about your app:
Cakephp and PHP versions
Database setup
Any cache configuration?
…What else more do we need to know?
PS: i don’t understood about the “offline” application… can you explain how it works?
Presently I am thinking of buying gaming laptop HP omen, also I need if there is a way to increase this numbers or reduce Apache CPU usage, memory has no issue as it only use less than 30% of memory but 100% of CPU with 220 concurrent request, same I have also deployed it using core server still have the same problem of running out of CPU
Enabling stuff like OPCache will also help big-time as PHP doesn’t have to compile everything all the time.
In bigger apps, I have seen huge increases in performance and decreases in resource usage.
Another thing I would recommend is using an SSD.
Laptop HDDs are notoriously slow, which can make it that your CPU (or Apache process) is waiting for your HDD to feed it the data it needs.
My suggestions (in order of “importance”):
update to PHP 7.x
use OPCache
use an SSD
use MariaDB instead of MySQL (it’s a drop-in so don’t worry about incompatibility)
don’t use wamp (it’s not made for production), but use nginx with php-fpm (Docker can help you with this, though on Windows, Hyper-V is needed for Docker)
@FinlayDaG33k thanks alot I have set it up using nginx and mariaDB, I connected one computer to it and it work fine but cgi/fastCGI is now using lot of CPU with one computer connected to it 3% CPU usage, although I want to buy gaming laptop tomorrow with 500gb ssd, 1TB HDD and 3.0ghz and 32gb ram and 4gb cache so that I can do real test as I am expecting the application to handle 350 to 500 concurrent request on LAN
I’d recommend not buying a gaming laptop for this purpose (but if you want to game, then go ahead).
If you don’t game on it as well, I’d recomment looking into something like a Dell XPS-series laptop.
But if all you are doing on it is run this application, you might be off better using something like an Intel NUC or Gigabyte Brix.
saves you some money for the same purpose.
As for the load testing, you could give Siege a try, it’ll basically hit your app with loads of concurrent requests.
The dedicated host would deal with load balancing and a different computer combined with it will be the most suitable and effective way of dealing with this issue since the issue is arising because of a blend of both.
Do note that a dedicated host is often off-site, which might not always be appreciated.
For a publicly available app, a dedicated webhost (or even VPS if you know what you’re doing) is desirable, but for something that only has to be available for the LAN (eg. an intranet portal) this is not always desired.