Vai al contenuto principale
BlogLinodeTempi di cron di Linode

Tempi di cron di Linode

Di seguito è riportata l'e-mail che ho inviato ai membri su host3 e host5. Per lo più questo vale solo per i primi membri, ovvero per quelli che si sono installati prima che avessi la possibilità di aggiornare i file system dei template. Non sarebbe male dare un'occhiata ai vostri orari di cron. Rimuovere o almeno spostare l'orario del cron di updatedb da giornaliero a settimanale sarebbe d'aiuto.

--

Caro Membro Linode,

Nel tentativo di ridurre il carico di I/O del disco sul server host, vi chiedo di
eseguire il seguente comando (come root) per la vostra distribuzione:

Debian
mv /etc/cron.daily/find /etc/cron.weekly/

RedHat
mv /etc/cron.daily/slocate.cron /etc/cron.weekly/

Gentoo
mv /etc/cron.daily/slocate /etc/cron.weekly/

Mandrake:
mv /etc/cron.daily/slocate.cron /etc/cron.weekly/

Slackware
mv /etc/cron.daily/slocate /etc/cron.weekly/

Fedora
Nessuna modifica necessaria

Questo sposta il lavoro "updatedb" dall'esecuzione giornaliera a quella settimanale. Il comando
updatedb" reindicizza l'intero filesystem, in modo da poter trovare rapidamente i file con il comando "locate
rapidamente con il comando "locate (filename)". Se non si usa spesso il comando
"locate", spostando l'aggiornamento dell'indice a livello settimanale (o eliminando completamente l'operazione di cron
completamente) contribuirà a ridurre il carico durante le prime ore del mattino. Attualmente,
attualmente l'host rallenta fino a diventare un vortice mentre molti Linodes tentano di reindicizzare i loro filesystem.
filesystem.

Questo non è un problema sugli host più recenti, dato che ho modificato i file system dei modelli e le persone hanno distribuito con questi file già spostati.
e le persone hanno distribuito con questi file già spostati.

Se si effettua la modifica e il file non viene trovato (il che indica che è già stato spostato), inviatemi un'e-mail e fatemi sapere.
che è già stato spostato), inviatemi un'e-mail e fatemelo sapere.

Grazie,
-Chris


Commenti (3)

  1. Author Photo

    [quote:90ec82635e=”caker”]Below is the email I sent to members on host3 and host5. Mostly this only applies to early members — member’s that deployed before I had a chance to update the template filesystems. It couldn’t hurt to take a look at your cron times. Removing, or at least moving the updatedb cron time from daily to weekly would help.
    [/quote]

    I would like to add that if you do not move your daily cron jobs to weekly as mentioned, or delete them, that you at least “randomize” the times that your daily cron jobs run. This is probably the best way to solve this problem as it allows you to install services as normal and not worry about whether they put cron jobs in daily or weekly, and yet help prevent huge loads on the Linode host at specific times. To do this, simply edit your /etc/crontab file, under the # run-parts entry.

    Here is an example section from an /etc/crontab file:

    [code]
    # 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
    [/code]

    These indicate that cron.hourly jobs run at 1 minute past the hour, cron.daily jobs run at 4:02 am every day, cron.weekly jobs run at 4:22 am every Monday, and cron.monthly jobs run at 4:42 am on the first day of each month.

    An example random change would be:

    [code]
    # run-parts
    16 * * * * root run-parts /etc/cron.hourly
    25 6 * * * root run-parts /etc/cron.daily
    45 6 * * 2 root run-parts /etc/cron.weekly
    55 6 3 * * root run-parts /etc/cron.monthly
    [/code]

    This moves the hourly jobs to the 16th minute of every hour, dailies to 6:25 am, weeklies to Wednesday at 6:45 am, and monthlies to 6:55 on the third day of each month.

    If we all stagger our times randomly like this, we can go a long way towards eliminating some common performance bottlenecks on Linodes.

    Thanks!

  2. Author Photo

    In addition to ‘randomising’ start times, I schedule maintenance cron jobs after hours or on weekends, 😀

  3. Author Photo

    Just a reminder that each time you upgrade the package containing the “find” utility (in Debian, it’s “findutil”), the cron job will likely be unpacked into /etc/cron.daily again, while the old cron job you have moved into /etc/cron.weekly will be left there as an orphan.

    So remember to move /etc/cron.daily/(find|slocate(.cron)?) back to /etc/cron.weekly (overwriting the orphan) after each upgrade of the parent package.

Lascia una risposta

Il vostro indirizzo e-mail non sarà pubblicato. I campi obbligatori sono contrassegnati da *