How to check the maximum number of threads supported by the caddy server

I currently use the caddy server, but I can’t know how much traffic it can withstand. Can you tell me how to check the thread amount information it supports? And how to modify it so that caddy can support more access

Howdy @wang, welcome to the Caddy community.

Being written in Go gives Caddy the advantage of using Goroutines for its request handling.

Here’s a decent primer on Goroutines: What are goroutines? And how do they actually work? | by João Henrique Machado Silva | The Polyglot Programmer | Medium

The Go scheduler automatically handles these lightweight Goroutines, spreading them out on a number of threads as appropriate to the workload. It will scale up to run threads on all of your CPU cores and then multiplex Goroutines among those threads as efficiently as possible.

That means Caddy doesn’t particularly have to manage threads and will automatically scale up to use all the resources it requires, up to the maximum made available to it. Give it more CPU cores, and it will use them, and spawn more threads, if it needs to.

3 Likes

Also you should raise the system’s ulimit for file descriptors, for really busy servers with lots of connections. (These are OS-enforced limits, and the same requirements apply to other busy web servers, not just Caddy.)

This topic was automatically closed after 30 days. New replies are no longer allowed.