How to set resource limits on PHP
In a previous post, we learned how to increase the memory limit on PHP by editing the php.ini file. But limits exist for a reason, and although you would probably love to give every process, every script, and every website unlimited CPU cycles, memory, and bandwidth, it just isn’t possible.
To begin editing, open /etc/php.ini in your text editor of choice. For example:
# nano /etc/php.ini
Look for the following values and change them to fit your requirements for your server. Below are just suggested values:
max_execution_time = 30
max_input_time = 30
memory_limit = 40M
post_max_size = 8M
upload_max_filesize = 2M
You may need to adjust the actual size limits to meet the requirements of certain content management systems or scripts, but be sure to not get carried away with being too liberal.
Tag: bandwidth, cpu, limits, memory, php, resources, server
AMD vs. Intel

Many shared web hosts like to advertise their server hardware, and the most popular thing to brag about these days is the brand of CPU used. Nearly all web hosts use processors made by AMD or Intel. Does it matter which one your host prefers? Is one faster over the other?
In short, it isn’t important what brand processor your host chooses. While one particular processor model might be faster than another, the more important factor is how heavily loaded a provider’s servers are. Will you be sharing a server with 10 other customers, 100, or 1,000?
Read More >>
Tag: amd, cpu, intel, processor, shared hosting, web hosting
5 Server checks for the New Year

Hopefully, it has not been a year since you have given your server a good checkup, but just in case you need a reminder, here are a few things to check at the start of 2010:
1. Log rotation. Normally, Linux will rotate logs for the kernel, web server, and other applications, saving older ones under alternate names. You should check in /var/log and make sure it’s all working as expected.
2. Filesystem. Run a basic filesystem check (fsck) to see if there are any disk errors. It is important to find them before they lead to data loss.
3. Updates. If you have not installed the latest updates, particularly kernel patches, do it now. An off day is the perfect time to perform a mandatory reboot.
4. Security check. Do a system-wide check for rootkits, vulnerabilities, viruses, and rogue scripts.
5. Memory and CPU usage. Run “top” and monitor CPU and memory usage for a few minutes. Check your load averages. Make sure all of it is within your desired parameters.
Now that you are done with that, enjoy your New Year with a little more peace of mind.
Photo: Flickr
Tag: cpu, filesystem, linux, logs, security, web server
When it's time to kill

No matter how stable your Linux installation is, no matter how much you invest in security, reliability, updated software, and system monitoring, something is eventually going to go wrong. On a virtual private server or a dedicated server, responsibility to fix it usually falls on you. If this were your Windows desktop computer, a help desk tech might tell you to simply reboot, but on a server, you need other options.
If you see a spike in CPU usage, an usually high amount of RAM being consumed, or other such anomalies, you could have a runaway process. Simply put, it is a program that is no longer behaving and may even be unresponsive. Linux has a quick and dirty solution: kill. If you happen to know the exact process number, just type: kill 8889, or whatever the process number is. If that does not help, add the “-9″ flag to force it:
kill -9 8889
You can also quickly kill off all instances of a program with “killall”. For example, if a program called “gamebot” is no longer functioning or is frozen, you would enter:
killall gamebot
Use “kill” sparingly, and be very careful with “killall”, but when the time to kill does arrive, you will know it and know what to do. For more information about “kill”, type “man kill” from the command line.
Photo Source: Flickr
Tag: cpu, kill, linux, ram, server, software, virtual private server
Is dual core the same as dual processor?

When shopping for a dedicated server, you may face the decision between a dual-processor server and a dual-core server. The two terms can be confusing, and newcomers to the industry could easily confuse one for the other.
A dual-core processor is one CPU with two separate parts. The operating system treats each core as a separate processor, but the cores may often share a cache. Think about it like a hamburger with two pieces of meat.
A dual processor server, on the other hand, has two physical CPUs. Just a two hamburgers are more expensive than a hamburger with two patties, dual processors are generally more expensive than dual core.
Read More >>
Tag: cpu, dedicated server, dual core, dual processor, processor, server hardware
Managing Linux System Programs and Processes

Question: Something is hogging the CPU cycles on my Linux dedicated server. It has gotten really slow. How can I monitor running programs and processes?
Answer: Linux has a handy little tool called “top” that, when run, reveals your top running processes. It also gives you information about your memory usage, server load average, logged-in users, swap usage, uptime, and total number of tasks.
Running “top” is simple. Just login to your server via SSH and type “top”. It will tell you the PID of the process, the user running it, the amount of memory it is using, the cpu percentage, memory percentage, time running, and the command’s name.
If you do happen to find a runaway process, press “q” to exit top, and then kill the process by typing “kill xxxx”, replacing the “xxxx” with the process PID number. If you find a process running under a suspicious user, you might have a security breach. For that, top cannot help you, but at least you will be a step closer to solving your problem.
Tag: cpu, dedicated server, linux, monitor, server, top