Koozali.org: home of the SME Server

Cron Scheduling

Offline derekb

  • **
  • 45
  • +0/-0
Cron Scheduling
« on: May 19, 2014, 03:43:14 PM »
hi

I have gone through the cron application note available i want to know if anyone will know at what time the cron.daily will be scheduled as standard to be run on the system? the reason for this is the system on a daily basis around 3pm (GMT+2) will go quite slow for all internal/external (Email and VPN) users. i have check the processes running during this time but cant see anything that resource dependant to would justify such a decrease in performance.

Code: [Select]
#------------------------------------------------------------
#              !!DO NOT MODIFY THIS FILE!!
#
# Manual changes will be lost when this file is regenerated.
#
# Please read the developer's guide, which is available
# at http://www.contribs.org/development/
#
# Copyright (C) 1999-2006 Mitel Networks Corporation
#------------------------------------------------------------
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=""

# run-parts

01 * * * * root run-parts /etc/cron.hourly
02 4 * * * root run-parts /etc/cron.daily
22 4 * * 0 root run-parts /etc/cron.weekly
42 4 1 * * root run-parts /etc/cron.monthly

*/5 * * * * root sh /home/scripts/rundhcpactiv.sh >/dev/null 2>&1

# logrotate
12 1 */7 * * root       /sbin/e-smith/signal-event logrotate



25 * * * * root /usr/bin/Learn.pl

# Backup task is disabled
# Workstation Backup task is disabled
2 4 * * * root sleep $[ $RANDOM \% 3600 ]; /sbin/e-smith/check4updates -m

# smeserver-clamscan filesystem scan
12      0       *       *       6       root    /sbin/e-smith/smeserver-clamscan




# Update OpenVPN bridge's CRL
5 * * * * root /etc/e-smith/events/actions/openvpn-bridge-update-crl 2>&1 /dev/null

24 1 * * * root squid -k rotate

36 20 * * 0 root  sleep $[ $RANDOM \% 60 ]; /sbin/e-smith/statusreport
# Usbdisks manager
*/2 * * * * root /usr/sbin/./usbdisks.sh &> /dev/null

System Specification

Code: [Select]
[root@netkeeper ~]# uname -r
2.6.18-274.7.1.el5
[root@netkeeper ~]#

Code: [Select]
[root@netkeeper ~]# cat /proc/version
Linux version 2.6.18-274.7.1.el5 (mockbuild@builder10.centos.org) (gcc version 4.1.2 20080704 (Red Hat 4.1.2-51)) #1 SMP Thu Oct 20 16:20:37 EDT 2011

Please let me know if you need any additional information.

Offline Stefano

  • *
  • 10,839
  • +2/-0
Re: Cron Scheduling
« Reply #1 on: May 19, 2014, 04:53:36 PM »
hi

I have gone through the cron application note available i want to know if anyone will know at what time the cron.daily will be scheduled as standard to be run on the system?

Code: [Select]
02 4 * * * root run-parts /etc/cron.daily

every day, at 04:02 am

Offline derekb

  • **
  • 45
  • +0/-0
Re: Cron Scheduling
« Reply #2 on: May 20, 2014, 08:58:34 AM »
Hi Stefano

Thank you for the prompt response.

Is there anything else i can check perhaps that would cause such a degradation in performance? When i check the processes running (using top) i didnt observe anything that would hold the resources that severely.

thank you,
Kind regards

Offline Stefano

  • *
  • 10,839
  • +2/-0
Re: Cron Scheduling
« Reply #3 on: May 20, 2014, 10:40:26 AM »
when you see that degradation, post here the output of top

please, give us more info about hw specs: disks, raid type, ram, cpu, number of users etc.

and, finally.. does it happen every day?

Offline derekb

  • **
  • 45
  • +0/-0
Re: Cron Scheduling
« Reply #4 on: May 20, 2014, 10:44:44 AM »
hi Stefano

i will post the output from top on the next occurrence but it i does happen daily.

I will also send full system specifications with the results.

Kind regards

Offline derekb

  • **
  • 45
  • +0/-0
Re: Cron Scheduling
« Reply #5 on: May 20, 2014, 11:50:09 AM »
Hi Stefano

Find below necessary information. Please let me know if this is adequate.

Code: [Select]
vendor_id       : GenuineIntel
cpu family      : 6
model           : 37
model name      : Intel(R) Core(TM) i3 CPU         560  @ 3.33GHz
stepping        : 5
cpu MHz         : 3325.094
cache size      : 4096 KB
physical id     : 0
siblings        : 4
core id         : 2
cpu cores       : 2
apicid          : 4
fdiv_bug        : no
hlt_bug         : no
f00f_bug        : no
coma_bug        : no
fpu             : yes
fpu_exception   : yes
cpuid level     : 11
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx rdtscp lm constant_tsc nonstop_tsc arat pni monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr sse4_1 sse4_2 popcnt lahf_lm [8]
bogomips        : 6649.95

processor       : 3
vendor_id       : GenuineIntel
cpu family      : 6
model           : 37
model name      : Intel(R) Core(TM) i3 CPU         560  @ 3.33GHz
stepping        : 5
cpu MHz         : 3325.094
cache size      : 4096 KB
physical id     : 0
siblings        : 4
core id         : 2
cpu cores       : 2
apicid          : 5
fdiv_bug        : no
hlt_bug         : no
f00f_bug        : no
coma_bug        : no
fpu             : yes
fpu_exception   : yes
cpuid level     : 11
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx rdtscp lm constant_tsc nonstop_tsc arat pni monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr sse4_1 sse4_2 popcnt lahf_lm [8]
bogomips        : 6649.95

Code: [Select]
[root@netkeeper ~]# free
             total       used       free     shared    buffers     cached
Mem:       1806292    1762940      43352          0      48812     989616
-/+ buffers/cache:     724512    1081780
Swap:      3637240        184    3637056
[root@netkeeper ~]#

Code: [Select]
[root@netkeeper ~]#  cat /proc/meminfo
MemTotal:      1806292 kB
MemFree:         46372 kB
Buffers:         48840 kB
Cached:         984144 kB
SwapCached:         76 kB
Active:        1258924 kB
Inactive:       383996 kB
HighTotal:      908800 kB
HighFree:         1408 kB
LowTotal:       897492 kB
LowFree:         44964 kB
SwapTotal:     3637240 kB
SwapFree:      3637056 kB
Dirty:              12 kB
Writeback:           0 kB
AnonPages:      609944 kB
Mapped:         139816 kB
Slab:            98040 kB
PageTables:       6512 kB
NFS_Unstable:        0 kB
Bounce:              0 kB
CommitLimit:   4540384 kB
Committed_AS:   997412 kB
VmallocTotal:   114680 kB
VmallocUsed:      7388 kB
VmallocChunk:   106992 kB
HugePages_Total:     0
HugePages_Free:      0
HugePages_Rsvd:      0
Hugepagesize:     4096 kB

Code: [Select]
[root@netkeeper ~]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/main-root
                      1.8T  302G  1.4T  18% /
/dev/md1               99M   25M   70M  27% /boot
tmpfs                 882M     0  882M   0% /dev/shm
/dev/sdc1             1.8T  1.6T  180G  90% /mnt/affadevice

Code: [Select]
[root@netkeeper ~]# sudo fdisk -l

Disk /dev/sda: 2000.3 GB, 2000398934016 bytes
255 heads, 63 sectors/track, 243201 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          13      104391   fd  Linux raid autodetect
/dev/sda2              14      243201  1953407610   fd  Linux raid autodetect

Disk /dev/sdb: 2000.3 GB, 2000398934016 bytes
255 heads, 63 sectors/track, 243201 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *           1          13      104391   fd  Linux raid autodetect
/dev/sdb2              14      243201  1953407610   fd  Linux raid autodetect

Disk /dev/md2: 2000.2 GB, 2000289267712 bytes
2 heads, 4 sectors/track, 488351872 cylinders
Units = cylinders of 8 * 512 = 4096 bytes

kind regards

Offline derekb

  • **
  • 45
  • +0/-0
Re: Cron Scheduling
« Reply #6 on: May 20, 2014, 12:23:27 PM »
top results:

Code: [Select]
top - 12:16:29 up 17 days, 21:20,  1 user,  load average: 0.02, 0.06, 0.08
Tasks: 319 total,   1 running, 318 sleeping,   0 stopped,   0 zombie
Cpu(s):  0.3%us,  0.2%sy,  1.0%ni, 97.1%id,  1.4%wa,  0.0%hi,  0.1%si,  0.0%st
Mem:   1806292k total,  1753344k used,    52948k free,    60208k buffers
Swap:  3637240k total,      184k used,  3637056k free,   986228k cached
sorry no image snapshot but im struggling to load it

Offline Stefano

  • *
  • 10,839
  • +2/-0
Re: Cron Scheduling
« Reply #7 on: May 20, 2014, 12:29:25 PM »
top results:

Code: [Select]
top - 12:16:29 up 17 days, 21:20,  1 user,  load average: 0.02, 0.06, 0.08
Tasks: 319 total,   1 running, 318 sleeping,   0 stopped,   0 zombie
Cpu(s):  0.3%us,  0.2%sy,  1.0%ni, 97.1%id,  1.4%wa,  0.0%hi,  0.1%si,  0.0%st
Mem:   1806292k total,  1753344k used,    52948k free,    60208k buffers
Swap:  3637240k total,      184k used,  3637056k free,   986228k cached
sorry no image snapshot but im struggling to load it

no image needed..

is this a "crisis" moment? if so, SME is ok, the issue is on another side/in another place

you forgot to tell us something about your users, your wan connection etc..

Offline derekb

  • **
  • 45
  • +0/-0
Re: Cron Scheduling
« Reply #8 on: May 20, 2014, 01:09:34 PM »
Hi Stefano

Thank you for the prompt response.

For the user we have an arrangement with some connected on the same LAN with a select few having VPN access with the remaining having remote email access:

During the crisis moment (for which the top results were taken earlier) the user connections were as follow:

VPN (Openvpn secure connection): 1 user
Remote email access: +/- 15 users (of which all have multiple devices with email configured - phone, laptop, tablet)
LAN: +/- 20 users

for the WAN we have a symmetrical business connection of 40mb up&down directly to one of South Africa's largest ISPs.

lastly, I have done quite a few test on the LAN/WAN connection to see if there is any latency created during the delay but have not observed anything. Also the performance degragation happen for all users (LAN, remote connected users). 

Offline Stefano

  • *
  • 10,839
  • +2/-0
Re: Cron Scheduling
« Reply #9 on: May 20, 2014, 02:20:37 PM »
I can't see anything wrong with your server.. it is almost "unactive"

can you describe your lan topology? I suspect that we have to look in another direction

Offline derekb

  • **
  • 45
  • +0/-0
Re: Cron Scheduling
« Reply #10 on: May 20, 2014, 03:46:23 PM »
Hi Stefano

We have quite a distributed network:

1: ETH0 Server is at main office connected directly onto a router with a static IP for our WAN.
2: ETH1 is configured for the LAN which is connected to a 24port gigabit switch for the distibuted network:
a: At the main office we have +/- 20 devices working on the network
b: we have a link between our main office to our warehouse - connectivity is 30mb up&down
i: at the warehouse we have +/- 20 devices on the network (8 users connected actively to the server for mail and file access)
ii: delay from warehouse to server is: 10-100ms
iii:
Code: [Select]
C:\Users\derek>ping -l 32768 10.0.0.1

Pinging 10.0.0.1 with 32768 bytes of data:
Reply from 10.0.0.1: bytes=32768 time=491ms TTL=64
Reply from 10.0.0.1: bytes=32768 time=340ms TTL=64
Reply from 10.0.0.1: bytes=32768 time=493ms TTL=64
Reply from 10.0.0.1: bytes=32768 time=365ms TTL=64

Ping statistics for 10.0.0.1:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 340ms, Maximum = 493ms, Average = 422ms
the above test was done from the warehouse.