Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replacement for CLK_TCK on Windows build #121

Open
ryanbogan opened this issue Jan 13, 2022 · 4 comments
Open

Replacement for CLK_TCK on Windows build #121

ryanbogan opened this issue Jan 13, 2022 · 4 comments
Labels

Comments

@ryanbogan
Copy link
Member

ryanbogan commented Jan 13, 2022

Child of #75

I am currently writing an install script for a Windows build for issue #828. What should the replacement be for this section of opensearch-tar-install.sh on a Windows build?

CLK_TCK=`/usr/bin/getconf CLK_TCK`
echo "-Dclk.tck=$CLK_TCK" >> $OPENSEARCH_HOME/config/jvm.options
@dblock
Copy link
Member

dblock commented Jan 14, 2022

Looks like this is used by performance-analyzer, let's move this issue into that repo.

Without this variable set PA will not start.

@dblock dblock transferred this issue from opensearch-project/opensearch-build Jan 14, 2022
@dblock dblock mentioned this issue Jan 14, 2022
7 tasks
@dblock
Copy link
Member

dblock commented Jan 14, 2022

@ryanbogan Note that PA is currently not included in the Windows distribution, so it's safe to skip this variable altogether for Windows right now.

@CEHENKLE
Copy link
Member

@ryanbogan hey can we get an update on this?

@kkhatua kkhatua added the windows label Sep 2, 2022
@dbwiddis
Copy link
Member

dbwiddis commented Oct 15, 2022

TLDR: Set any value you want, Windows doesn't use this constant, but 10,000,000 is probably the best option.

Short answer: If you have to pick a value, choose 10,000,000, which represents the number of increments of the displayed "ticks" value per second, which correlates directly to the practical usage (converting "jiffies" to a unit of time) of Linux CLK_TCK (ticks per second) and matches TimeSpan.TicksPerSecond in .NET.

Long answer:

Arguably, you could choose 64, which is the actual number of clock ticks per second, although it's never used in any calculation and while accurate, is useless. The windows clock changes in 1/64 of a second increments, which equates to 15.625 milliseconds. (This is roughly comparable to the 10 millisecond ticks of most Linux distributions with CLK_TCK of 100.) However, that value is never actually used in userspace.

However, the unit displayed to users for the System clock and any time-related metrics is in 100 nanosecond units. (This is amusing as it appears to give an artificial precision, but the values increment in multiple of 156250.).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants