Disabling several pieces of Javascript to improve performance on large databases

  • Based upon the [URL=‘http://www.fogproject.org/wiki/index.php/Testimonials#Madison_Metropolitan_School_District.2C_Madison.2C_WI.2C_USA’]Testimonials page on the WIKI[/URL], our FOG deployment is about the largest out there, so I’m not sure how many others have run into the sluggishness on the web interface out of the box that we have. I just had to replicate a few changes we had done in the past after doing a total re-install on our server for Ubuntu 14.04 and FOG 1.0.1, so I figured this might be useful to others and belong somewhere other than a text file on my Dropbox.

    Host Search - Disable search while typing (Also affects group and image searches):

    /var/www/fog/management/js/fog.js (depending on which distro you choose)

    if (this.SearchTimer) clearTimeout(this.SearchTimer);

    this.SearchTimer = setTimeout(function()
                }, Options.SearchDelay);

    if (this.SearchTimer) clearTimeout(this.SearchTimer);

            this.SearchTimer = setTimeout(function()
            }, Options.SearchDelay);

    Disable pinging of Host Search results:

    /var/www/fog/management/js/fog.js (depending on which distro you choose)

    $(’.ping’, Container).fogPing();[/CODE]
    Disable Dashboard bandwidth graphs:

    /var/www/fog/management/js/fog.dashboard.js (depending on which distro you choose)

    GraphBandwidth = $('#graph-bandwidth', '#content-inner');
    GraphBandwidthFilterTransmit = $('#graph-bandwidth-filters-transmit', '#graph-bandwidth-filters');
    GraphBandwidthFilterTransmitActive = GraphBandwidthFilterTransmit.hasClass('active');
    // Bandwidth Graph - init plot
    GraphBandwidthPlot = $.plot(GraphBandwidth, [[0,0]],
        'colors': ['#7386AD', '#91a73c'],
            'mode':        'time'
            'min':        '0',
            'tickFormatter': function (v)
                return v + ' MB/s';
                'show': true
            show:        false,
    // Bandwidth Graph - TX/RX Filter
    $('#graph-bandwidth-filters-transmit, #graph-bandwidth-filters-receive', '#graph-bandwidth-filters').click(function()
        // Blur -> add active class -> remove active class from old active item
        // Update title
        $('#graph-bandwidth-title > span').eq(0).html($(this).html());
        // Set variable
        GraphBandwidthFilterTransmitActive = (GraphBandwidthFilterTransmit.hasClass('active') ? true : false)
        // Update graph
        // Prevent default action
        return false;
    // Bandwidth Graph - Time Filter
    $('#graph-bandwidth-filters div:eq(2) a').click(function()
        // Blur -> add active class -> remove active class from old active item
        // Update title
        $('#graph-bandwidth-title > span').eq(1).html($(this).html());
        // Update max data points variable
        GraphBandwidthMaxDataPoints = $(this).attr('rel');
        // Update graph
        // Prevent default action
        return false;
    // Bandwidth Graph - start thread
    }, (200));[/CODE]

    Before applying these changes, the web interface was generally slow and unstable and mysql and/or apache would be pegging at least one CPU core and using a lot of memory. After making the above changes, memory usage is about ~1GB or under, CPU usage is fairly light, and the web interface is fast and completely usable.

  • Somewhat old thread, but you can disable the ping on the host lists by going to FOG Configuration->FOG Settings->General Settings->FOG_HOST_LOOKUP and clearing the checkbox. Easier than disabling the javascript file. There’s a possibility this was introduced in the time between your post and my find, but if not, it’s here for others.

  • Senior Developer

    Some more help in speeding up your interface could be to disabling the animation effects in:

    FOG Configuration->FOG Settings->General Settings->FOG_USE_ANIMATION_EFFECTS Uncheck the box and save.

    Enjoy the speed increase.

  • Sweet!

    I did still have some other slowness after this when modifying larger groups, I’ve been tweaking MySQL settings in my.cnf to alleviate that. Here’s my most recent version, this would vary somewhat depending on the beefiness of your server’s hardware.


    The MySQL database server configuration file.

    You can copy this to one of:

    - “/etc/mysql/my.cnf” to set global options,

    - “~/.my.cnf” to set user-specific options.

    One can use all long options that the program supports.

    Run program with --help to get a list of available options and with

    –print-defaults to see which it would actually understand and use.

    For explanations see


    This will be passed to all mysql clients

    It has been reported that passwords should be enclosed with ticks/quotes

    escpecially if they contain “#” chars…

    Remember to edit /etc/mysql/debian.cnf when changing the socket location.

    port = 3306
    socket = /var/run/mysqld/mysqld.sock

    Here is entries for some specific programs

    The following values assume you have at least 32M ram

    This was formally known as [safe_mysqld]. Both versions are currently parsed.

    socket = /var/run/mysqld/mysqld.sock
    nice = 0


    * Basic Settings

    user = mysql
    pid-file = /var/run/mysqld/mysqld.pid
    socket = /var/run/mysqld/mysqld.sock
    port = 3306
    basedir = /usr
    datadir = /var/lib/mysql
    tmpdir = /tmp
    lc-messages-dir = /usr/share/mysql

    Instead of skip-networking the default is now to listen only on

    localhost which is more compatible and is not less secure.

    bind-address =

    * Fine Tuning

    tmp_table_size = 128M
    max_heap_table_size = 128M
    key_buffer = 16M
    max_allowed_packet = 16M
    thread_stack = 192K
    thread_cache_size = 8

    This replaces the startup script and checks MyISAM tables if needed

    the first time they are touched

    myisam-recover = BACKUP
    max_connections = 500
    #table_cache = 64
    thread_concurrency = 16

    * Query Cache Configuration

    query_cache_limit = 1M
    query_cache_size = 64M

    * Logging and Replication

    Both location gets rotated by the cronjob.

    Be aware that this log type is a performance killer.

    As of 5.1 you can enable the log at runtime!

    #general_log_file = /var/log/mysql/mysql.log
    #general_log = 1

    Error log - should be very few entries.

    log_error = /var/log/mysql/error.log

    Here you can see queries with especially long duration

    #log_slow_queries = /var/log/mysql/mysql-slow.log
    #long_query_time = 2

    The following can be used as easy to replay backup logs or for replication.

    note: if you are setting up a replication slave, see README.Debian about

    other settings you may need to change.

    #server-id = 1
    #log_bin = /var/log/mysql/mysql-bin.log
    expire_logs_days = 10
    max_binlog_size = 100M
    slow-query-log = 1
    slow-query-log-file = /var/log/mysql/mysql-slow.log
    #binlog_do_db = include_database_name
    #binlog_ignore_db = include_database_name

    * InnoDB

    InnoDB is enabled by default with a 10MB datafile in /var/lib/mysql/.

    Read the manual for more InnoDB related options. There are many!

    * Security Features

    Read the manual, too, if you want chroot!

    chroot = /var/lib/mysql/

    For generating SSL certificates I recommend the OpenSSL GUI “tinyca”.




    max_allowed_packet = 16M

    #no-auto-rehash # faster start of mysql but no tab completition

    key_buffer = 512M

    * IMPORTANT: Additional settings that can override those from this file!

    The files must end with ‘.cnf’, otherwise they’ll be ignored.

    !includedir /etc/mysql/conf.d/[/CODE]

    I imagine some of my performance issues have to do with choosing to install on Ubuntu 14.04? I’ve seen the talk of it being a problem, but haven’t seen anyone list anything specific.

  • Senior Developer


    I’ve added these files to the svn trunk. I’m not using them directly, but a simple mv the other files to backup names and renaming of these files as their respective counterparts will work.