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

Tz #1084

Merged
merged 2 commits into from
Oct 13, 2015
Merged

Tz #1084

merged 2 commits into from
Oct 13, 2015

Conversation

connortechnology
Copy link
Member

Setting the TZ ENV variable prevents every gettimeofday call from reading /etc/timezone which actually has a noticeable performance hit.

@liucougar
Copy link
Contributor

according to: http://www.gnu.org/software/libc/manual/html_node/TZ-Variable.html

the default value for TZ would be ‘TZ=:/etc/localtime’.

may I know how do you test whether this has a performance hit or not?

@connortechnology
Copy link
Member Author

The problem is.. on my ubuntu and debian based servers, TZ is not set in the ENV.

How I tested was watching cpu consumption on a raspberry pi. I noticed this while stracing zmc, and then setting TZ and watching cpu load. On a low end device like a raspberry pi it is noticeable.

@liucougar
Copy link
Contributor

it seems raspherry pi uses eglibc (not normal glibc), so it may have a different TZ default?

@connortechnology
Copy link
Member Author

This behaviour was seen on ubuntu as well.

If you want to see the behaviour, run strace zmc -m 1 (or whatever monitor id). seems to be worse on a http stream than an rtsp.

Now set TZ and notice that it no longer is hitting /etc/localtime

TZ=:/etc/localtime strace zmc -m 1

@liucougar
Copy link
Contributor

just tried strace on ubuntu 15.04, against a RTSP camera, i am not seeing any call to gettimeofday in my strace log (I don't have http cameras to test against)

@knight-of-ni
Copy link
Member

I'm going to merge this as the discussion does not hint at any undesirable side effects.
Let's get this into master so others can test.

knight-of-ni pushed a commit that referenced this pull request Oct 13, 2015
@knight-of-ni knight-of-ni merged commit d666710 into master Oct 13, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants