Squid Web Cache wiki

Squid Web Cache documentation

🔗 Profiling Squid Servers

Is Squid running too slow? Would you like to investigate why and try to help us make Squid perform faster? Here’s a few pointers.

🔗 What should I be looking at?

In short: everything. Disk IO, memory use, CPU use, network use. You need to get a handle on what your equipment is capable of and identify things that are out of whack. It doesn’t take much practice to be able to do this, so don’t worry too much!

🔗 CPU usage

Squid is a CPU-intensive application (since, after all, it spends all of its time processing incoming data and generating data to send.) But there’s many different types of CPU usage which can identify what you’re running out of.

🔗 Resource usage

The commonly available UNIX tools vmstat and iostat let you scratch the surface of your current server resource usage. vmstat will generally display information pertaining to memory usage, CPU usage, device interrupts, disk IO (in and out) and the amount of system paging going on. iostat lets you drill down into the IO operations scheduled on each physical disk.

I generally run them as vmstat 1 and iostat 1, keeping an eye on things. You should also consider setting up graphing to track various resource variables and watch usage trends.

🔗 What sort of things impact the performance of my Squid ?

Squid will start suffering if you run out of any of your server resources. There’s a few things that frequently occur:

🔗 How can I see what Squid is actually doing?

The best thing you can do to identify where all your CPU usage is going is to use a process or system profiler. Personally, I use oprofile. gprof isn’t at all accurate with modern CPU clockspeeds. There’s other options - hwpmc under FreeBSD, for example, can do somewhat what oprofile can but it currently has trouble getting any samples from Squid in userspace. Grr. perfmon is also an option if you don’t have root access on the server.

OProfile under Linux is easy to use and has quite a low overhead.

Here’s how I use oprofile:

Just remember:

🔗 Load Testing Tools

It’s also useful to profile the connection and request limits. Here are some tools for testing behaviour at various request and connection loads.

To the FAQ Index

Navigation: Site Search, Site Pages, Categories, 🔼 go up