* [gentoo-user] Custom Timer Frequency (CONFIG_HZ)?
@ 2011-08-11 6:56 Pandu Poluan
2011-08-11 7:27 ` [gentoo-user] " Nikos Chantziaras
0 siblings, 1 reply; 5+ messages in thread
From: Pandu Poluan @ 2011-08-11 6:56 UTC (permalink / raw
To: gentoo-user
Just wondering, is it possible to specify a custom timer frequency?
E.g., HZ=500 instead of one of the canned values (100, 250, 300,
1000).
Rgds,
--
FdS Pandu E Poluan
~ IT Optimizer ~
• Blog : http://pepoluan.tumblr.com
• Linked-In : http://id.linkedin.com/in/pepoluan
^ permalink raw reply [flat|nested] 5+ messages in thread
* [gentoo-user] Re: Custom Timer Frequency (CONFIG_HZ)?
2011-08-11 6:56 [gentoo-user] Custom Timer Frequency (CONFIG_HZ)? Pandu Poluan
@ 2011-08-11 7:27 ` Nikos Chantziaras
2011-08-11 7:35 ` Pandu Poluan
0 siblings, 1 reply; 5+ messages in thread
From: Nikos Chantziaras @ 2011-08-11 7:27 UTC (permalink / raw
To: gentoo-user
On 08/11/2011 09:56 AM, Pandu Poluan wrote:
> Just wondering, is it possible to specify a custom timer frequency?
> E.g., HZ=500 instead of one of the canned values (100, 250, 300,
> 1000).
It is possible, but it's a bad idea because non-standard values can
result in driver breakage. Some code assumes specific timer
granularities (100Hz = 10ms, 250Hz = 4ms, etc). This usually happens
with values above 1000Hz, so it might be possible to experiment with
non-standard sub-1000Hz values.
But why do you want a custom value anyway?
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [gentoo-user] Re: Custom Timer Frequency (CONFIG_HZ)?
2011-08-11 7:27 ` [gentoo-user] " Nikos Chantziaras
@ 2011-08-11 7:35 ` Pandu Poluan
2011-08-11 8:06 ` Nikos Chantziaras
0 siblings, 1 reply; 5+ messages in thread
From: Pandu Poluan @ 2011-08-11 7:35 UTC (permalink / raw
To: gentoo-user
On Thu, Aug 11, 2011 at 14:27, Nikos Chantziaras <realnc@arcor.de> wrote:
> On 08/11/2011 09:56 AM, Pandu Poluan wrote:
>>
>> Just wondering, is it possible to specify a custom timer frequency?
>> E.g., HZ=500 instead of one of the canned values (100, 250, 300,
>> 1000).
>
> It is possible, but it's a bad idea because non-standard values can result
> in driver breakage. Some code assumes specific timer granularities (100Hz =
> 10ms, 250Hz = 4ms, etc). This usually happens with values above 1000Hz, so
> it might be possible to experiment with non-standard sub-1000Hz values.
>
> But why do you want a custom value anyway?
>
Well, for a firewall, I've calculated (gathered and extrapolated from
a lot of sources), the latency per-packet is usually less than 1 ms,
at worst still less than 2 ms.
Thus, setting the timer freq to 100 Hz (as suggested for 'normal'
server load) means the timeslice is way too long (10 ms per time
slice).
So, I speculate that better -- and uniform -- performance will be
achieved with a timer freq of 500 Hz.
Of course, this is a wild speculation/guess from me. I never quite
understand netfilter/xtables' relation to the timeslices, so I may be
talking nonsense :-)
Rgds,
--
FdS Pandu E Poluan
~ IT Optimizer ~
• Blog : http://pepoluan.tumblr.com
• Linked-In : http://id.linkedin.com/in/pepoluan
^ permalink raw reply [flat|nested] 5+ messages in thread
* [gentoo-user] Re: Custom Timer Frequency (CONFIG_HZ)?
2011-08-11 7:35 ` Pandu Poluan
@ 2011-08-11 8:06 ` Nikos Chantziaras
2011-08-11 14:56 ` Pandu Poluan
0 siblings, 1 reply; 5+ messages in thread
From: Nikos Chantziaras @ 2011-08-11 8:06 UTC (permalink / raw
To: gentoo-user
On 08/11/2011 10:35 AM, Pandu Poluan wrote:
> On Thu, Aug 11, 2011 at 14:27, Nikos Chantziaras<realnc@arcor.de> wrote:
>> On 08/11/2011 09:56 AM, Pandu Poluan wrote:
>>>
>>> Just wondering, is it possible to specify a custom timer frequency?
>>> E.g., HZ=500 instead of one of the canned values (100, 250, 300,
>>> 1000).
>>
>> It is possible, but it's a bad idea because non-standard values can result
>> in driver breakage. Some code assumes specific timer granularities (100Hz =
>> 10ms, 250Hz = 4ms, etc). This usually happens with values above 1000Hz, so
>> it might be possible to experiment with non-standard sub-1000Hz values.
>>
>> But why do you want a custom value anyway?
>>
>
> Well, for a firewall, I've calculated (gathered and extrapolated from
> a lot of sources), the latency per-packet is usually less than 1 ms,
> at worst still less than 2 ms.
>
> Thus, setting the timer freq to 100 Hz (as suggested for 'normal'
> server load) means the timeslice is way too long (10 ms per time
> slice).
>
> So, I speculate that better -- and uniform -- performance will be
> achieved with a timer freq of 500 Hz.
>
> Of course, this is a wild speculation/guess from me. I never quite
> understand netfilter/xtables' relation to the timeslices, so I may be
> talking nonsense :-)
This assumes that networking is dependent on the timer interrupt, which
doesn't seem to be the case; going from 100Hz to 1000Hz will not result
in network latencies dropping by 9ms. I know because I tried it on a
server.
The only case where network latency improved with a higher HZ was with a
game server (Counter-Strike) and that's only because that game's server
component is timer dependent when calculating the game world (to do 1000
updates per second it needs a HZ value of 1000). So that application
has some real-time demands, meaning a high HZ value helps. Otherwise,
you can stick to 100Hz on a server. Higher values won't change anything
and will only reduce throughput (though not by much anyway, which is why
some people set 1000Hz even on servers.)
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [gentoo-user] Re: Custom Timer Frequency (CONFIG_HZ)?
2011-08-11 8:06 ` Nikos Chantziaras
@ 2011-08-11 14:56 ` Pandu Poluan
0 siblings, 0 replies; 5+ messages in thread
From: Pandu Poluan @ 2011-08-11 14:56 UTC (permalink / raw
To: gentoo-user
On Thu, Aug 11, 2011 at 15:06, Nikos Chantziaras <realnc@arcor.de> wrote:
> On 08/11/2011 10:35 AM, Pandu Poluan wrote:
>>
>> On Thu, Aug 11, 2011 at 14:27, Nikos Chantziaras<realnc@arcor.de> wrote:
>>>
>>> On 08/11/2011 09:56 AM, Pandu Poluan wrote:
>>>>
>>>> Just wondering, is it possible to specify a custom timer frequency?
>>>> E.g., HZ=500 instead of one of the canned values (100, 250, 300,
>>>> 1000).
>>>
>>> It is possible, but it's a bad idea because non-standard values can
>>> result
>>> in driver breakage. Some code assumes specific timer granularities
>>> (100Hz =
>>> 10ms, 250Hz = 4ms, etc). This usually happens with values above 1000Hz,
>>> so
>>> it might be possible to experiment with non-standard sub-1000Hz values.
>>>
>>> But why do you want a custom value anyway?
>>>
>>
>> Well, for a firewall, I've calculated (gathered and extrapolated from
>> a lot of sources), the latency per-packet is usually less than 1 ms,
>> at worst still less than 2 ms.
>>
>> Thus, setting the timer freq to 100 Hz (as suggested for 'normal'
>> server load) means the timeslice is way too long (10 ms per time
>> slice).
>>
>> So, I speculate that better -- and uniform -- performance will be
>> achieved with a timer freq of 500 Hz.
>>
>> Of course, this is a wild speculation/guess from me. I never quite
>> understand netfilter/xtables' relation to the timeslices, so I may be
>> talking nonsense :-)
>
> This assumes that networking is dependent on the timer interrupt, which
> doesn't seem to be the case; going from 100Hz to 1000Hz will not result in
> network latencies dropping by 9ms. I know because I tried it on a server.
>
That's what I was concerned of.
> The only case where network latency improved with a higher HZ was with a
> game server (Counter-Strike) and that's only because that game's server
> component is timer dependent when calculating the game world (to do 1000
> updates per second it needs a HZ value of 1000). So that application has
> some real-time demands, meaning a high HZ value helps. Otherwise, you can
> stick to 100Hz on a server. Higher values won't change anything and will
> only reduce throughput (though not by much anyway, which is why some people
> set 1000Hz even on servers.)
>
Hmmm... I *do* feel better response (interaction-wise via SSH) if I
use >100, so I think I'll settle for 250 Hz.
Thanks for the explanation!
Rgds,
--
FdS Pandu E Poluan
~ IT Optimizer ~
• Blog : http://pepoluan.tumblr.com
• Linked-In : http://id.linkedin.com/in/pepoluan
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2011-08-11 14:58 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-11 6:56 [gentoo-user] Custom Timer Frequency (CONFIG_HZ)? Pandu Poluan
2011-08-11 7:27 ` [gentoo-user] " Nikos Chantziaras
2011-08-11 7:35 ` Pandu Poluan
2011-08-11 8:06 ` Nikos Chantziaras
2011-08-11 14:56 ` Pandu Poluan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox