Why does visiting this page crank up the fan on my CPU? Why does it act so resource hungry? Did I code it wrong? Is it possible to transfer the dynamic content generation into PHP arrays and code, if there is no other way to optimize it? If so, how?
Info: The way it can tell if a site is up or not is by looking for a specific image in the “images” folder on the particular website. Clever, but is this the cause of the resource craving?
P.S.: Also, it sometimes doesn’t even load completely, so it may take a few refreshes to get the whole page to show (esp. the source code). There is definitely something wrong here!
Can you be more specific about “fan on my CPU”? Are you referring to your laptop/desktop when visiting the site, or the physical server the site is hosted on?
If the latter, then yes, it could be related to your PHP code or countless other things. There is a tool called Munin, that may be of use. You would need to install it on the server and run your application a few times and see what conclusions you can make from the graphs it provides.
If it is your laptop or desktop, then my guess is something else is running at the same time you load your website. Have you tried loading it without any addons/extensions enabled in your browser of chocie?
I can’t tell if it’s the CPU or GPU fan, but some fan on my PC definitely churns up the minute I hit the page, and nearly locks up my browser. In fact, it locks up Chrome so that I can’t even access or highlight (select) any source code from “View Source” page.
Here is My System:
CPU: Intel Core i7 3770 (Vanilla)
GPU: EVGA NVIDIA GeForce GTX 750Ti
RAM: 4 x 8 GB Kingston HyperX Genesis XMP 1600 (32GB Total)
MOTHERBOARD: ASUS P8Z77-V LE PLUS
PSU: EVGA SuperNOVA 850 P2
Did you try this to rule out it being an addon/extension you have installed? There is literally NOTHING to the page you linked to, so I don’t see any reason for it to spin up your CPU or your GPU.
I Updated Reply with Chrome Extensions List. I will take it down soon for obvious security reasons. But see if you can find any problems with whats installed. Thanks!
I use Firefox, which has an option to restart with all add-ons disabled. I imagine Chrome has something similar. Try that and see if the problem still occurs. If it doesn’t, you’ll know it’s an add-on and you can test them one by one to see which.
Just ran Chrome Task Manager which confirmed that it’s the page itself. It had 13 under CPU. I donno if that’s 13 processes, threads, or what. It’s time to reexamine the slightly complicated dynamic JavaScript on the page.
The rest of the stuff barely used any CPU/Memory at all!
Yes, there may be a small amount of code, yet the code is slightly complicated. have you notice the onerror, and onload attributes point to code even within the document.write. It’s not spaghetti code, but is still complex in its actual logic.
I have no problems with it in either Firefox or Chromium - and I have extensions like WOT on FF, too. I am seeing a reported JS error, but it’s not stopping the page loading. (And my system is much older and lower spec than @JamesAndersonJr’s; only 4 GB RAM, for a start.)
I use Linux too, 64 bit, yes, I can hear my fan when I’m dong a lot of work, but seeing how I have 16 GB of RAM and an 8 core CPU, it rarely needs to overwork itself. However, my 6 year old laptop, also running Linux, had zero issues on it.
My desktop uses Debian Jessie and my Laptop is running LinuxMint 17