DaemonForums  

Go Back   DaemonForums > FreeBSD > FreeBSD General

FreeBSD General Other questions regarding FreeBSD which do not fit in any of the categories below.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 29th August 2008
Yuka Yuka is offline
Complete BSD nubcake
 
Join Date: Jul 2008
Posts: 31
Default Need help with NTP + VMWare

I have an install of FreeBSD 7.0 for my webserver running on a VMWare platform. (VMWare Server, will be VMWare ESXi in the near future.)

The problem is that the time is very slow.... 3 to 4 seconds in the real world is 1 second on the FreeBSD box... VMWare tools doesn't support time sync with the host on FreeBSD. I've tried setting kern.hz=100 but I didn't notice much of a change.

I set the time earlier today, at roughly 10:00am EST... it is now 1:19 pm EST but the server reads 11:20am EST.

This isn't good for a webserver.

I'm also new to FreeBSD and 'nix in general.

I'm thinking some sort of ntpd implementation may be the best route. Time doesn't need to be 100% accurate at all times since the websites that this server hosts aren't the most mission critical things but I'd like the time to be within 5 minutes of the actual time.

If I kick off ntpd -g via cron when the system boots, that should handle the issue, but how do I make ntpd check the time every X minutes. I'm not worried about network traffic as the box sits on the same copper gigabit switch as my NTP server. I'm thinking if I set it to check every minute it should help me out quite a bit in keeping proper time.

Can anyone give me a hand or some insight that might help fix the issue?
Reply With Quote
  #2   (View Single Post)  
Old 29th August 2008
DutchDaemon's Avatar
DutchDaemon DutchDaemon is offline
Real Name: Ben
Spam Refugee
 
Join Date: Jul 2008
Location: Rotterdam, The Netherlands
Posts: 336
Default

As far as I know, ntpd has its own internal 'check cycles', where it performs all kinds of calculations on averages, delays, time slew, and what have you. I don't think there's a way to interfere with that process. You may be better off using the ntpdate command from cron. Given the large deviations in time, you will probably need ntpdate -b [ntp-host] (note below) at boot-up (to sync the initial time), and maybe even from cron as well (where you would normally not use the -b option). See man ntpdate.

In /etc/rc.conf:
ntpdate_enable="YES"
ntpdate_flags="-b ntp-hostname"

Last edited by DutchDaemon; 29th August 2008 at 08:51 PM.
Reply With Quote
  #3   (View Single Post)  
Old 29th August 2008
Yuka Yuka is offline
Complete BSD nubcake
 
Join Date: Jul 2008
Posts: 31
Default

Thanks, DutchDaemon!

I'll give that a shot and report back with the results.
Reply With Quote
  #4   (View Single Post)  
Old 29th August 2008
anomie's Avatar
anomie anomie is offline
Local
 
Join Date: Apr 2008
Location: Texas
Posts: 445
Default

Quote:
Originally Posted by Yuka
I'm thinking some sort of ntpd implementation may be the best route.
Hammering an ntpd server with the frequency that would be required to (mostly) "fix" this is probably not a good approach.

Try adding the following to /boot/loader.conf:
Code:
kern.hz=100
hint.apic.0.disabled=1
(There are a number of gotchas when running FBSD as a vmware guest.)
__________________
Kill your t.v.
Reply With Quote
  #5   (View Single Post)  
Old 30th August 2008
Yuka Yuka is offline
Complete BSD nubcake
 
Join Date: Jul 2008
Posts: 31
Default

Thanks, anomie!

I'm trying both suggestions as we speak. I'll know the results shortly! Thanks for the help, both of you!


UPDATE: So far so good. It gets the date from the NTP server on boot. I'll monitor it throughout the weekend and report back later on. Thanks again!

Last edited by Yuka; 30th August 2008 at 12:17 AM.
Reply With Quote
  #6   (View Single Post)  
Old 31st August 2008
windependence's Avatar
windependence windependence is offline
Real Name: Tim
Shell Scout
 
Join Date: May 2008
Location: Phoenix, Arizona
Posts: 116
Default

Quote:
Originally Posted by anomie View Post
Hammering an ntpd server with the frequency that would be required to (mostly) "fix" this is probably not a good approach.

Try adding the following to /boot/loader.conf:
Code:
kern.hz=100
hint.apic.0.disabled=1
(There are a number of gotchas when running FBSD as a vmware guest.)
This is the correct solution. here is a link to the VMware knowledge base article:

http://kb.vmware.com/selfservice/mic...=0%200%2044545

-Tim
__________________
www.windependence.org
Get your Windependence today!
Reply With Quote
  #7   (View Single Post)  
Old 31st August 2008
Yuka Yuka is offline
Complete BSD nubcake
 
Join Date: Jul 2008
Posts: 31
Default

So far so good, time is on the dot after making the changes on Friday.

Tim, I'm going to look into your posted solution, thanks! Also, how much of it applies to FreeBSD since the solution is geared towards a Linux guest machine?
Reply With Quote
  #8   (View Single Post)  
Old 22nd September 2008
Yuka Yuka is offline
Complete BSD nubcake
 
Join Date: Jul 2008
Posts: 31
Default

As a follow up...

I employed all of the tweaks listed above and ntpd. The tweaks helped to slow the rate of variance between the machine's time and the real world, however there was still a variance before I implemented ntpd.

Once I implemented ntpd I noticed some really weird time issues. The machine would boot up fine then time would vary at seeming random speeds throughout the course of a few days.

I had to reboot the box a few times, but I think ntpd has set up it's averages and realized what is happening. The time is now synched with my NTP server.

Thanks to everyone for their advice!
Reply With Quote
  #9   (View Single Post)  
Old 22nd September 2008
18Googol2's Avatar
18Googol2 18Googol2 is offline
Real Name: whoami
Spam Deminer
 
Join Date: Apr 2008
Location: pwd
Posts: 283
Default

Cron helps me to sync time in my machines at mid night:

Code:
00      00       *       *       *       root    ntpdate your_local_time_server
Couldnt be easier
__________________
The power of plain text? It can control an entire OS
Reply With Quote
Old 25th September 2008
windependence's Avatar
windependence windependence is offline
Real Name: Tim
Shell Scout
 
Join Date: May 2008
Location: Phoenix, Arizona
Posts: 116
Default

Going to ESXi will solve this or you and runs MUCH faster with less resources than server.

I'm sitting in VMware cert class right now. I'll report back when I get finished.

-Tim
__________________
www.windependence.org
Get your Windependence today!
Reply With Quote
Reply

Tags
ntp, vmware

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
FreeBSD as firewall/router on VMware ESXi Bruco FreeBSD General 12 6th December 2008 08:37 PM
import physical freeBSD into VMWARE (ESX) server as a vServer ccc FreeBSD General 6 3rd October 2008 07:04 AM
FreeBSD 6.1, VMWare Server , and ESX Diceman FreeBSD Installation and Upgrading 5 3rd August 2008 02:42 AM
How to install vmware player in Ubuntu 7.10 or 8.04 tutorial. unixdude Other BSD and UNIX/UNIX-like 0 18th June 2008 10:23 PM
NIC-less FreeBSD and VMware Nirbo FreeBSD General 11 11th May 2008 05:34 AM


All times are GMT. The time now is 03:21 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick