Results 1 to 13 of 13
  1. #1

    mySQL Expert Required

    Code:
    mysql> SHOW STATUS;
    +--------------------------+-----------+
    | Variable_name            | Value     |
    +--------------------------+-----------+
    | Aborted_clients          | 17        |
    | Aborted_connects         | 0         |
    | Bytes_received           | 10832133  |
    | Bytes_sent               | 355322715 |
    | Com_admin_commands       | 0         |
    | Com_alter_table          | 2         |
    | Com_analyze              | 0         |
    | Com_backup_table         | 0         |
    | Com_begin                | 0         |
    | Com_change_db            | 2013      |
    | Com_change_master        | 0         |
    | Com_check                | 0         |
    | Com_commit               | 0         |
    | Com_create_db            | 0         |
    | Com_create_function      | 0         |
    | Com_create_index         | 0         |
    | Com_create_table         | 0         |
    | Com_delete               | 271       |
    | Com_delete_multi         | 0         |
    | Com_drop_db              | 0         |
    | Com_drop_function        | 0         |
    | Com_drop_index           | 0         |
    | Com_drop_table           | 0         |
    | Com_flush                | 0         |
    | Com_grant                | 0         |
    | Com_ha_close             | 0         |
    | Com_ha_open              | 0         |
    | Com_ha_read              | 0         |
    | Com_insert               | 469       |
    | Com_insert_select        | 0         |
    | Com_kill                 | 0         |
    | Com_load                 | 0         |
    | Com_load_master_data     | 0         |
    | Com_load_master_table    | 0         |
    | Com_lock_tables          | 0         |
    | Com_optimize             | 0         |
    | Com_purge                | 0         |
    | Com_rename_table         | 0         |
    | Com_repair               | 0         |
    | Com_replace              | 678       |
    | Com_replace_select       | 0         |
    | Com_reset                | 0         |
    | Com_restore_table        | 0         |
    | Com_revoke               | 0         |
    | Com_rollback             | 0         |
    | Com_savepoint            | 0         |
    | Com_select               | 20914     |
    | Com_set_option           | 2         |
    | Com_show_binlog_events   | 0         |
    | Com_show_binlogs         | 0         |
    | Com_show_create          | 11        |
    | Com_show_databases       | 17        |
    | Com_show_fields          | 6         |
    | Com_show_grants          | 0         |
    | Com_show_keys            | 7         |
    | Com_show_logs            | 0         |
    | Com_show_master_status   | 0         |
    | Com_show_new_master      | 0         |
    | Com_show_open_tables     | 0         |
    | Com_show_processlist     | 0         |
    | Com_show_slave_hosts     | 0         |
    | Com_show_slave_status    | 0         |
    | Com_show_status          | 6         |
    | Com_show_innodb_status   | 0         |
    | Com_show_tables          | 105       |
    | Com_show_variables       | 1         |
    | Com_slave_start          | 0         |
    | Com_slave_stop           | 0         |
    | Com_truncate             | 0         |
    | Com_unlock_tables        | 0         |
    | Com_update               | 3121      |
    | Com_update_multi         | 0         |
    | Connections              | 1953      |
    | Created_tmp_disk_tables  | 11        |
    | Created_tmp_tables       | 47        |
    | Created_tmp_files        | 7         |
    | Delayed_insert_threads   | 0         |
    | Delayed_writes           | 0         |
    | Delayed_errors           | 0         |
    | Flush_commands           | 1         |
    | Handler_commit           | 0         |
    | Handler_delete           | 289       |
    | Handler_read_first       | 6778      |
    | Handler_read_key         | 212945    |
    | Handler_read_next        | 73750799  |
    | Handler_read_prev        | 2322616   |
    | Handler_read_rnd         | 14638     |
    | Handler_read_rnd_next    | 41449397  |
    | Handler_rollback         | 0         |
    | Handler_update           | 53465     |
    | Handler_write            | 292462    |
    | Key_blocks_used          | 7764      |
    | Key_read_requests        | 5262398   |
    | Key_reads                | 21750     |
    | Key_write_requests       | 356208    |
    | Key_writes               | 11808     |
    | Max_used_connections     | 14        |
    | Not_flushed_key_blocks   | 0         |
    | Not_flushed_delayed_rows | 0         |
    | Open_tables              | 40        |
    | Open_files               | 65        |
    | Open_streams             | 0         |
    | Opened_tables            | 1530      |
    | Questions                | 29564     |
    | Qcache_queries_in_cache  | 0         |
    | Qcache_inserts           | 0         |
    | Qcache_hits              | 0         |
    | Qcache_lowmem_prunes     | 0         |
    | Qcache_not_cached        | 0         |
    | Qcache_free_memory       | 0         |
    | Qcache_free_blocks       | 0         |
    | Qcache_total_blocks      | 0         |
    | Rpl_status               | NULL      |
    | Select_full_join         | 0         |
    | Select_full_range_join   | 0         |
    | Select_range             | 3184      |
    | Select_range_check       | 0         |
    | Select_scan              | 2579      |
    | Slave_open_temp_tables   | 0         |
    | Slave_running            | OFF       |
    | Slow_launch_threads      | 0         |
    | Slow_queries             | 54        |
    | Sort_merge_passes        | 0         |
    | Sort_range               | 344       |
    | Sort_rows                | 21572     |
    | Sort_scan                | 239       |
    | Table_locks_immediate    | 30991     |
    | Table_locks_waited       | 17        |
    | Threads_cached           | 0         |
    | Threads_created          | 1952      |
    | Threads_connected        | 2         |
    | Threads_running          | 1         |
    | Uptime                   | 11200     |
    +--------------------------+-----------+
    133 rows in set (0.00 sec)
    I cannot utilize the Search function in my boards, the mySQL queries timeout. Everything else seems to be working alright though, but Invision Support says the problem is with mySQL server. Does this look alright?

    Can provide the my-large.cnf if required.

  2. #2
    Join Date
    Dec 2001
    Location
    127.0.0.1
    Posts
    3,640
    What kind of hardware is this running on, how many users are on the board? What kind of bandwidth is it using? These are all questions to put these stats into context.
    Simpli Networks, LLC :: http://www.simplinetworks.com :: Proudly 100% Owned.
    Providing Affordable Managed Cloud/VPS Servers & Server Management Solutions.
    We offer REAL 24x7x365 in-house support - proudly serving our customers since 2005!
    Want to learn more? Give us a call - +1 (844) 4SIMPLI or email sales[@]simplinetworks.com today!

  3. #3
    Join Date
    Apr 2001
    Location
    FL, USA
    Posts
    925
    I've seen the search function on Invision bog down a number of servers. I think part of it has to do with the implementation of their search function and how it manages a row by row query in mysql.

    I would have to get back to our client about this as he hired a programmer to clean up or change some of the search routines.

    The server was a dual xeon 2.4 box with 2GB of ram. I suspected he may have needed more ram.

    Moving to mysql 4 did improve things a bit. I notice that:
    Qcache_queries_in_cache | 0 |
    | Qcache_inserts | 0 |
    | Qcache_hits | 0 |
    | Qcache_lowmem_prunes | 0 |
    | Qcache_not_cached | 0 |
    | Qcache_free_memory | 0 |
    | Qcache_free_blocks | 0 |
    | Qcache_total_blocks | 0 |

    Do you not have query caching enabled?

    We save you time, money, and frustration by handling the server management tasks required to run an online business successfully.
    No prodding required. We just do it right the first time. Red Hat, MySQL, Plesk, and cPanel certified staff.

  4. #4
    I have a 2400+ with 512MB of RAM (I know, not the greatest)

    I have as many as 20 people simultaneously connected to the boards (nor is it very big, but users post lots of times a day).

    For your use, here is my.cnf:

    Code:
    # Example MySQL config file for large systems.
    #
    # This is for a large system with memory = 512M where the system runs mainly
    # MySQL.
    #
    # You can copy this file to
    # /etc/my.cnf to set global options,
    # mysql-data-dir/my.cnf to set server-specific options (in this
    # installation this directory is /usr/local/var) or
    # ~/.my.cnf to set user-specific options.
    #
    # In this file, you can use all long options that a program supports.
    # If you want to know which options a program supports, run the program
    # with the "--help" option.
    
    # The following options will be passed to all MySQL clients
    [client]
    #password	= your_password
    port		= 3306
    socket		= /tmp/mysql.sock
    
    # Here follows entries for some specific programs
    
    # The MySQL server
    [mysqld]
    port		= 3306
    socket		= /tmp/mysql.sock
    skip-locking
    key_buffer = 256M
    max_allowed_packet = 1M
    table_cache = 256
    sort_buffer_size = 1M
    read_buffer_size = 1M
    myisam_sort_buffer_size = 64M
    thread_cache = 8
    query_cache_size= 16M
    # Try number of CPU's*2 for thread_concurrency
    thread_concurrency = 2
    
    # Don't listen on a TCP/IP port at all. This can be a security enhancement,
    # if all processes that need to connect to mysqld run on the same host.
    # All interaction with mysqld must be made via Unix sockets or named pipes.
    # Note that using this option without enabling named pipes on Windows
    # (via the "enable-named-pipe" option) will render mysqld useless!
    # 
    #skip-networking
    
    # Replication Master Server (default)
    # binary logging is required for replication
    log-bin
    
    # required unique id between 1 and 2^32 - 1
    # defaults to 1 if master-host is not set
    # but will not function as a master if omitted
    server-id	= 1
    
    # Replication Slave (comment out master section to use this)
    #
    # To configure this host as a replication slave, you can choose between
    # two methods :
    #
    # 1) Use the CHANGE MASTER TO command (fully described in our manual) -
    #    the syntax is:
    #
    #    CHANGE MASTER TO MASTER_HOST=<host>, MASTER_PORT=<port>,
    #    MASTER_USER=<user>, MASTER_PASSWORD=<password> ;
    #
    #    where you replace <host>, <user>, <password> by quoted strings and
    #    <port> by the master's port number (3306 by default).
    #
    #    Example:
    #
    #    CHANGE MASTER TO MASTER_HOST='125.564.12.1', MASTER_PORT=3306,
    #    MASTER_USER='joe', MASTER_PASSWORD='secret';
    #
    # OR
    #
    # 2) Set the variables below. However, in case you choose this method, then
    #    start replication for the first time (even unsuccessfully, for example
    #    if you mistyped the password in master-password and the slave fails to
    #    connect), the slave will create a master.info file, and any later
    #    change in this file to the variables' values below will be ignored and
    #    overridden by the content of the master.info file, unless you shutdown
    #    the slave server, delete master.info and restart the slaver server.
    #    For that reason, you may want to leave the lines below untouched
    #    (commented) and instead use CHANGE MASTER TO (see above)
    #
    # required unique id between 2 and 2^32 - 1
    # (and different from the master)
    # defaults to 2 if master-host is set
    # but will not function as a slave if omitted
    #server-id       = 2
    #
    # The replication master for this slave - required
    #master-host     =   <hostname>
    #
    # The username the slave will use for authentication when connecting
    # to the master - required
    #master-user     =   <username>
    #
    # The password the slave will authenticate with when connecting to
    # the master - required
    #master-password =   <password>
    #
    # The port the master is listening on.
    # optional - defaults to 3306
    #master-port     =  <port>
    #
    # binary logging - not required for slaves, but recommended
    #log-bin
    
    # Point the following paths to different dedicated disks
    #tmpdir		= /tmp/		
    #log-update 	= /path-to-dedicated-directory/hostname
    
    # Uncomment the following if you are using BDB tables
    #bdb_cache_size = 64M
    #bdb_max_lock = 100000
    
    # Uncomment the following if you are using InnoDB tables
    #innodb_data_home_dir = /usr/local/var/
    #innodb_data_file_path = ibdata1:10M:autoextend
    #innodb_log_group_home_dir = /usr/local/var/
    #innodb_log_arch_dir = /usr/local/var/
    # You can set .._buffer_pool_size up to 50 - 80 %
    # of RAM but beware of setting memory usage too high
    #innodb_buffer_pool_size = 256M
    #innodb_additional_mem_pool_size = 20M
    # Set .._log_file_size to 25 % of buffer pool size
    #innodb_log_file_size = 64M
    #innodb_log_buffer_size = 8M
    #innodb_flush_log_at_trx_commit = 1
    #innodb_lock_wait_timeout = 50
    
    [mysqldump]
    quick
    max_allowed_packet = 16M
    
    [mysql]
    no-auto-rehash
    # Remove the next comment character if you are not familiar with SQL
    #safe-updates
    
    [isamchk]
    key_buffer = 128M
    sort_buffer_size = 128M
    read_buffer = 2M
    write_buffer = 2M
    
    [myisamchk]
    key_buffer = 128M
    sort_buffer_size = 128M
    read_buffer = 2M
    write_buffer = 2M
    
    [mysqlhotcopy]
    interactive-timeout

  5. #5
    Anyone have any input?

  6. #6
    Join Date
    Dec 2001
    Location
    127.0.0.1
    Posts
    3,640
    Hmmm.... usually the large mysql config is used for servers with 2GB of RAM+. Might want to try and downgrade to the normal config and see what happens, or get more RAM

    # This is for a large system with memory = 512M where the system runs mainly MySQL.
    That might be your problem there. MySQL isn't the main use of the box.
    Simpli Networks, LLC :: http://www.simplinetworks.com :: Proudly 100% Owned.
    Providing Affordable Managed Cloud/VPS Servers & Server Management Solutions.
    We offer REAL 24x7x365 in-house support - proudly serving our customers since 2005!
    Want to learn more? Give us a call - +1 (844) 4SIMPLI or email sales[@]simplinetworks.com today!

  7. #7
    Originally posted by jslivko
    Hmmm.... usually the large mysql config is used for servers with 2GB of RAM+. Might want to try and downgrade to the normal config and see what happens, or get more RAM



    That might be your problem there. MySQL isn't the main use of the box.
    It is the main use, 95% of all traffic is on Invision.

    Nonetheless, I'll give the next step down config a try...

  8. #8
    Join Date
    Jul 2001
    Location
    Glasgow, Scotland
    Posts
    129
    Notice how Aborted_clients and Table_locks_waited are both 17.
    If I'm guessing that aborted clients only happen when you try to search, then that could indicate that either mysql itself or some filesystem lock doesn't get allocated fast enough, so it has to abort.
    In other words, the server is overloaded.

    Also what huck said, if InvisionBoard really does search by row by row queries, that is the most horrible search algorythm ever implemented!
    Almost certain that is why then.....
    My development blog - (un)Interesting codesnippets and the occational code-related rant!

  9. #9
    Is 2400+ and 512MB enough for what I'm trying to do?

  10. #10
    It's overkill really.

  11. #11
    All I have is one site with direct downloads (200MB in size), and Invision Boards with 140,000 posts and 20 simultaneous users.

  12. #12
    Invision is an incredible resource hog. I admin a forum using it, and as the size grew over the first year I often found myself having to rewrite various queries and algorithms to keep our (mostly dedicated) server from being crushed under relatively light use.

    Its searches are some of the worst though...they generally take the form "select id from posts where post like '%keyword%'" (with a few other attributes, but you get the idea). The selected IDs are then combined and stored in a single text field in a search results table, and result views are generated by reading back that row and using it in a 'where id in ($posts)' clause. Not to mention several more horribly broken bits of PHP processing, but I don't want to get carried away.

  13. #13
    Yes, my server (dedicated) CPU gets overloaded at times.

    Any suggestions?

    It's PHP and mySQL taking the resources.

    I've got a 2400+ with 512MB RAM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •