[Dnsmasq-discuss] Dnsmasq on high load

Simon Kelley simon at thekelleys.org.uk
Wed Mar 11 21:56:52 GMT 2015


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 10/03/15 13:39, Chen Wei wrote:
> On Tue, Mar 10, 2015 at 11:15:38AM +0200, Анатолий Мулярский
> wrote:
>> I'm using dnsmasq as a caching DNS-server for 2000+ users. 
>> cache-size=9500 dns-forward-max=4000
>> 
>> Periodically I got the message: dnsmasq[2272]: failed to send
>> packet: Resource temporarily unavailable
>> 
>> Can someone suggest me how to optimize my configuration for high
>> load and get rid of the above message?
>> 
> 
> Sounds like the 10k problem.
> 
> My understanding is dnsmasq was designed to be small and portable.
> Its select() loop works very well for most of us, but has
> limitation when comes to high concurrency connections. FD_SETSIZE
> along has a upper limit of 1024 on Linux.

I don't think that's the problem. For UDP, you can handle as many
connections as you like with two (or even one) sockets. Once you want
random source ports for upstream connections, you need more, but
dnsmasq should limit the number of those sockets to avoid
file-descriptor problems.

> 
> Assuming most dnsmasq are running on Linux, I have contemplated a 
> simple wrap over select and epoll so dnsmasq can use the more
> efficient epoll when available. But then should dnsmasq go
> multi-threading? and if the features keeps piling up, could dnsmasq
> still small enough for embedded devices?
> 
> 
A judgment I have to make frequently. In this case, I don't think
multi-threading is needed or desirable.


Cheers,

Simon.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iEYEARECAAYFAlUAuiQACgkQKPyGmiibgrdRTACcC3p/T22Yx+sqYOTeMdxLHppq
JRsAoKhhrd/v1amTyWyEpqW/8XdTYBUW
=T1sr
-----END PGP SIGNATURE-----



More information about the Dnsmasq-discuss mailing list