PDA

View Full Version : Eva, please help with server optimization


Njörd Eriksson
Fri 7th May '04, 10:33am
1. is this on dedicated or shared virual server

Dedicated Server


2. your server specs. For example:

cpu speed/type single or dual cpus): Intel Celeron 2.2 GHz, 400 MHz FSB
how much memory installed: 512 MB ECC RAM (upgrades up to 2GB available)
hard drive type/configuration: Dual 80 GB EIDE, IDE RAID Mirror (via IDE RAID Controller)
linux distributor or windows version: Red Hat Linux release 7.3 (Valhalla)
apache/IIS version: Server version: Apache/1.3.27 (Unix) (Red-Hat/Linux)
Server built: Sep 24 2003 16:24:51
PHP version: php 4.3.3
MySQL version: mysql 3.23.49


3. if you use mysql 4.x instead of mysql 3.23.x, do you have any innodb type databases/tables on your server ?

Using 3.23.49 version.

4. if possible how mysql was compiled/installed

With Ensim Pro 3.5.19


5. your top stats

12:14pm up 2 days, 19:32, 1 user, load average: 1.13, 1.54, 1.79
119 processes: 105 sleeping, 14 running, 0 zombie, 0 stopped
CPU states: 31.1% user, 16.2% system, 28.5% nice, 24.0% idle
Mem: 505848K av, 480860K used, 24988K free, 0K shrd, 20528K buff
Swap: 2040244K av, 94632K used, 1945612K free 244096K cached

PID USER PRI NI SIZE RSS SHARE STAT %CPU %MEM TIME COMMAND
13198 mysql 33 10 20844 16M 10984 R N 36.7 3.3 0:01 mysqld
13197 admin1 15 0 9212 9212 3760 S 14.8 1.8 0:00 php
13150 root 15 0 1140 1140 856 R 0.9 0.2 0:00 top
13199 admin1 15 0 1752 1752 1260 R 0.9 0.3 0:00 ads.pl
13202 admin1 15 0 1752 1752 1260 R 0.9 0.3 0:00 ads.pl
13192 admin1 15 0 1752 1752 1260 R 0.7 0.3 0:00 ads.pl
13201 admin1 15 0 1752 1752 1260 R 0.7 0.3 0:00 ads.pl
13204 admin1 15 0 1752 1752 1260 R 0.7 0.3 0:00 ads.pl
17 root 15 0 0 0 0 SW 0.1 0.0 2:59 kjournald
21716 apache 15 0 5900 4352 3600 S 0.1 0.8 0:09 httpd
21719 apache 15 0 5736 4184 3612 S 0.1 0.8 0:10 httpd
8070 apache 15 0 5656 4184 3576 S 0.1 0.8 0:03 httpd
12952 apache 15 0 5504 3996 3608 S 0.1 0.7 0:00 httpd
13126 apache 15 0 5504 3996 3604 S 0.1 0.7 0:00 httpd
13173 admin1 15 0 2108 2108 1276 R 0.1 0.4 0:00 ads.pl
13179 root 5 -10 2548 2416 1860 S < 0.1 0.4 0:00 sendmail
13196 admin1 16 0 928 928 784 S 0.1 0.1 0:00 php-script
1 root 15 0 472 432 412 S 0.0 0.0 0:08 init
2 root 15 0 0 0 0 SW 0.0 0.0 0:00 keventd
3 root 15 0 0 0 0 SW 0.0 0.0 0:08 kapmd



Here's another one:

1:13pm up 2 days, 20:31, 2 users, load average: 4.24, 3.33, 2.14
113 processes: 97 sleeping, 12 running, 4 zombie, 0 stopped
CPU states: 40.2% user, 8.2% system, 3.7% nice, 47.8% idle
Mem: 505848K av, 498376K used, 7472K free, 0K shrd, 49644K buff
Swap: 2040244K av, 94532K used, 1945712K free 235968K cached

PID USER PRI NI SIZE RSS SHARE STAT %CPU %MEM TIME COMMAND
26290 admin1 20 0 9204 9204 3760 S 15.2 1.8 0:00 php
26298 admin1 16 0 10680 10M 3764 R 9.1 2.1 0:00 php
26294 mysql 26 10 20432 16M 11004 R N 3.3 3.2 0:00 mysqld
12753 #22000 15 0 105M 105M 45832 S 2.7 21.2 82:58 mlnet
26295 admin1 15 0 0 0 0 Z 1.1 0.0 0:00 ads.pl <defunct>
25469 root 15 0 620 620 468 R 0.9 0.1 0:01 find
25669 root 15 0 1172 1172 856 R 0.7 0.2 0:01 top
26296 admin1 15 0 1752 1752 1260 R 0.7 0.3 0:00 ads.pl
26299 admin1 15 0 1752 1752 1260 R 0.7 0.3 0:00 ads.pl
26297 admin1 16 0 924 924 784 S 0.3 0.1 0:00 php-script
26300 mysql 26 10 20432 16M 11004 R N 0.3 3.2 0:00 mysqld
26301 admin1 16 0 0 0 0 Z 0.3 0.0 0:00 ads.pl <defunct>
17 root 15 0 0 0 0 SW 0.1 0.0 3:02 kjournald
21713 apache 15 0 5968 4424 3772 S 0.1 0.8 0:11 httpd
21716 apache 15 0 5912 4364 3600 S 0.1 0.8 0:10 httpd
25874 apache 15 0 0 0 0 Z 0.1 0.0 0:00 httpd <defunct>
26289 admin1 16 0 928 928 784 S 0.1 0.1 0:00 php-script
1 root 15 0 472 432 412 S 0.0 0.0 0:08 init
2 root 15 0 0 0 0 SW 0.0 0.0 0:00 keventd
3 root 15 0 0 0 0 SW 0.0 0.0 0:09 kapmd

Load averages fluctuate typcially between 0.70 and 4.50 depending on how busy the forum/server is (with values between 1.50 and 3.00 most of the time). Occasionally and rarely, brief peaks of up to 10.00 are reached what is undesired, as it slows things down extremely. If somehow possible, I'd definitely like to keep the *NIX load below 3.00 at all times.



6. your mysql configuration variables located at /etc/my.cnf or c:\my.cnf so post the contents inside of my.cnf (minus any passwords of course).


my.cnf:

[client]
port=3306



mysqladmin -u root -p variables
Enter password:
+---------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Variable_name | Value |
+---------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| back_log | 50 |
| basedir | /usr/ |
| bdb_cache_size | 8388600 |
| bdb_log_buffer_size | 32768 |
| bdb_home | /var/lib/mysql/ |
| bdb_max_lock | 10000 |
| bdb_logdir | |
| bdb_shared_data | OFF |
| bdb_tmpdir | /tmp/ |
| bdb_version | Sleepycat Software: Berkeley DB 3.2.9a: (September 11, 2003) |
| binlog_cache_size | 32768 |
| character_set | latin1 |
| character_sets | latin1 big5 cp1251 cp1257 croat czech danish dec8 dos estonia euc_kr gb2312 gbk german1 greek hebrew hp8 hungarian koi8_ru koi8_ukr latin2 latin5 swe7 usa7 win1250 win1251 win1251ukr ujis sjis tis620 |
| concurrent_insert | ON |
| connect_timeout | 5 |
| datadir | /var/lib/mysql/ |
| delay_key_write | ON |
| delayed_insert_limit | 100 |
| delayed_insert_timeout | 300 |
| delayed_queue_size | 1000 |
| flush | OFF |
| flush_time | 0 |
| have_bdb | YES |
| have_gemini | NO |
| have_innodb | DISABLED |
| have_isam | YES |
| have_raid | NO |
| have_openssl | NO |
| init_file | |
| innodb_additional_mem_pool_size | 1048576 |
| innodb_buffer_pool_size | 8388608 |
| innodb_data_file_path | |
| innodb_data_home_dir | |
| innodb_file_io_threads | 4 |
| innodb_force_recovery | 0 |
| innodb_thread_concurrency | 8 |
| innodb_flush_log_at_trx_commit | 1 |
| innodb_fast_shutdown | ON |
| innodb_flush_method | |
| innodb_lock_wait_timeout | 50 |
| innodb_log_arch_dir | |
| innodb_log_archive | OFF |
| innodb_log_buffer_size | 1048576 |
| innodb_log_file_size | 5242880 |
| innodb_log_files_in_group | 2 |
| innodb_log_group_home_dir | |
| innodb_mirrored_log_groups | 1 |
| interactive_timeout | 28800 |
| join_buffer_size | 131072 |
| key_buffer_size | 8388600 |
| language | /usr/share/mysql/english/ |
| large_files_support | ON |
| locked_in_memory | OFF |
| log | OFF |
| log_update | OFF |
| log_bin | OFF |
| log_slave_updates | OFF |
| log_long_queries | OFF |
| long_query_time | 10 |
| low_priority_updates | OFF |
| lower_case_table_names | 0 |
| max_allowed_packet | 1048576 |
| max_binlog_cache_size | 4294967295 |
| max_binlog_size | 1073741824 |
| max_connections | 100 |
| max_connect_errors | 10 |
| max_delayed_threads | 20 |
| max_heap_table_size | 16777216 |
| max_join_size | 4294967295 |
| max_sort_length | 1024 |
| max_user_connections | 0 |
| max_tmp_tables | 32 |
| max_write_lock_count | 4294967295 |
| myisam_max_extra_sort_file_size | 256 |
| myisam_max_sort_file_size | 2047 |
| myisam_recover_options | 0 |
| myisam_sort_buffer_size | 8388608 |
| net_buffer_length | 16384 |
| net_read_timeout | 30 |
| net_retry_count | 10 |
| net_write_timeout | 60 |
| open_files_limit | 0 |
| pid_file | /var/lib/mysql/216-55-167-3.dedicated.abac.net.pid |
| port | 3306 |
| protocol_version | 10 |
| record_buffer | 131072 |
| record_rnd_buffer | 131072 |
| query_buffer_size | 0 |
| safe_show_database | OFF |
| server_id | 0 |
| slave_net_timeout | 3600 |
| skip_locking | ON |
| skip_networking | OFF |
| skip_show_database | OFF |
| slow_launch_time | 2 |
| socket | /home/virtual/FILESYSTEMTEMPLATE/.mysqlsock/mysql.sock |
| sort_buffer | 2097144 |
| sql_mode | 0 |
| table_cache | 64 |
| table_type | MYISAM |
| thread_cache_size | 0 |
| thread_stack | 65536 |
| transaction_isolation | READ-COMMITTED |
| timezone | GMT |
| tmp_table_size | 33554432 |
| tmpdir | /tmp/ |
| version | 3.23.58 |
| wait_timeout | 28800 |
+---------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+

7. your mysql extended-status output either still telnet as root user type

+--------------------------+------------+
| Variable_name | Value |
+--------------------------+------------+
| Aborted_clients | 29 |
| Aborted_connects | 293 |
| Bytes_received | 635430901 |
| Bytes_sent | 4223837165 |
| Com_admin_commands | 0 |
| Com_alter_table | 4 |
| Com_analyze | 0 |
| Com_backup_table | 0 |
| Com_begin | 0 |
| Com_change_db | 153393 |
| 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 | 5271 |
| Com_drop_db | 0 |
| Com_drop_function | 0 |
| Com_drop_index | 0 |
| Com_drop_table | 0 |
| Com_flush | 0 |
| Com_grant | 0 |
| Com_insert | 48133 |
| Com_insert_select | 567 |
| Com_kill | 0 |
| Com_load | 0 |
| Com_load_master_table | 0 |
| Com_lock_tables | 6 |
| Com_optimize | 4 |
| Com_purge | 0 |
| Com_rename_table | 0 |
| Com_repair | 0 |
| Com_replace | 5994 |
| Com_replace_select | 0 |
| Com_reset | 0 |
| Com_restore_table | 0 |
| Com_revoke | 0 |
| Com_rollback | 0 |
| Com_select | 1583878 |
| Com_set_option | 528 |
| Com_show_binlogs | 0 |
| Com_show_create | 528 |
| Com_show_databases | 5 |
| Com_show_fields | 528 |
| Com_show_grants | 0 |
| Com_show_keys | 0 |
| Com_show_logs | 0 |
| Com_show_master_status | 0 |
| Com_show_open_tables | 0 |
| Com_show_processlist | 0 |
| Com_show_slave_status | 0 |
| Com_show_status | 1 |
| Com_show_innodb_status | 0 |
| Com_show_tables | 18 |
| Com_show_variables | 10 |
| Com_slave_start | 0 |
| Com_slave_stop | 0 |
| Com_truncate | 0 |
| Com_unlock_tables | 0 |
| Com_update | 261595 |
| Connections | 153693 |
| Created_tmp_disk_tables | 4214 |
| Created_tmp_tables | 70267 |
| Created_tmp_files | 0 |
| Delayed_insert_threads | 0 |
| Delayed_writes | 0 |
| Delayed_errors | 0 |
| Flush_commands | 1 |
| Handler_delete | 42106 |
| Handler_read_first | 176713 |
| Handler_read_key | 75226278 |
| Handler_read_next | 25112818 |
| Handler_read_prev | 27 |
| Handler_read_rnd | 12242818 |
| Handler_read_rnd_next | 1488957479 |
| Handler_update | 37728879 |
| Handler_write | 8906776 |
| Key_blocks_used | 7793 |
| Key_read_requests | 85578195 |
| Key_reads | 416566 |
| Key_write_requests | 230209 |
| Key_writes | 157281 |
| Max_used_connections | 100 |
| Not_flushed_key_blocks | 0 |
| Not_flushed_delayed_rows | 0 |
| Open_tables | 64 |
| Open_files | 115 |
| Open_streams | 0 |
| Opened_tables | 79663 |
| Questions | 2213837 |
| Select_full_join | 5132 |
| Select_full_range_join | 8842 |
| Select_range | 394332 |
| Select_range_check | 0 |
| Select_scan | 307534 |
| Slave_running | OFF |
| Slave_open_temp_tables | 0 |
| Slow_launch_threads | 475 |
| Slow_queries | 5579 |
| Sort_merge_passes | 0 |
| Sort_range | 128966 |
| Sort_rows | 117279347 |
| Sort_scan | 124951 |
| Table_locks_immediate | 3154336 |
| Table_locks_waited | 22700 |
| Threads_cached | 0 |
| Threads_created | 153692 |
| Threads_connected | 2 |
| Threads_running | 1 |
| Uptime | 269306 |
+--------------------------+------------+



8. is your vB the only thing on the server? or other scripts & sites which utilise php and mysql?
Yes, my forum is basically the only thing that utilizes PHP and mySQL. I'm also running a banner exchange which is quite busy (that's the ads.pl you can see), and Topsites CGI, as well as free webhosting (without CGI/PHP/SSI allowance) but those pages have hardly any weight on the load.

9. how many average and max concurrent users on your vB forum ? and what your cookie timeout is ?

Typically 80-120 users

1800 cookie timeout

800+ MB database with 700+ MB attachments (in file system.)

10. create a file named phpinfo.php and place this code in it and post the url/link to it from your web site

Okay, this poses a slight problem, as the site runs in Ensim Pro High Security mode, and it seems it doesn't want to execute phpinfo. I can execute the file in the root web folder but then it uses PHP 4.3.6 (which I installed once) instead of PHP 4.3.3 in CGI mode which the site with the forum (under Ensim Pro High Security) uses.

If there is a work-around and you need those data, please let me know.

In the meantime I shall paste my php.ini settings if that helps:


short_open_tag = On
asp_tags = Off
precision = 14
y2k_compliance = On
output_buffering = Off
zlib.output_compression = Off
implicit_flush = Off
unserialize_callback_func=
serialize_precision = 100
allow_call_time_pass_reference = On

; Safe Mode
safe_mode = Off
safe_mode_gid = Off
safe_mode_include_dir =
safe_mode_exec_dir =
safe_mode_allowed_env_vars = PHP_ TZ
safe_mode_protected_env_vars = LD_LIBRARY_PATH

; Misc
expose_php = On

;;;;;;;;;;;;;;;;;;;
; Resource Limits ;
;;;;;;;;;;;;;;;;;;;

max_execution_time = 60 ; Maximum execution time of each script, in seconds
max_input_time = 60 ; Maximum amount of time each script may spend parsing request data
memory_limit = 64M ; Maximum amount of memory a script may consume (8MB)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Error handling and logging ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

error_reporting = E_ALL & ~E_NOTICE
display_errors = On
display_startup_errors = Off
log_errors = Off
log_errors_max_len = 1024
ignore_repeated_errors = Off
ignore_repeated_source = Off
report_memleaks = On
track_errors = Off

;;;;;;;;;;;;;;;;;
; Data Handling ;
;;;;;;;;;;;;;;;;;
variables_order = "EGPCS"
register_globals = On
post_max_size = 64M

; Magic quotes
magic_quotes_gpc = On
magic_quotes_runtime = Off
magic_quotes_sybase = Off

; Automatically add files before or after any PHP document.
auto_prepend_file =
auto_append_file =

; PHP's built-in default is text/html
default_mimetype = "text/html"

;;;;;;;;;;;;;;;;;;;;;;;;;
; Paths and Directories ;
;;;;;;;;;;;;;;;;;;;;;;;;;

; UNIX: "/path1:/path2"
include_path = ".:/php/includes:/usr/share/php"
doc_root =
user_dir =
extension_dir = /usr/lib/php4
enable_dl = On

;;;;;;;;;;;;;;;;
; File Uploads ;
;;;;;;;;;;;;;;;;

; Whether to allow HTTP file uploads.
file_uploads = On

; Maximum allowed size for uploaded files.
upload_max_filesize = 2M


;;;;;;;;;;;;;;;;;;
; Fopen wrappers ;
;;;;;;;;;;;;;;;;;;

; Whether to allow the treatment of URLs (like http:// or ftp://) as files.
allow_url_fopen = On

; Default timeout for socket based streams (seconds)
default_socket_timeout = 60

;;;;;;;;;;;;;;;;;;;
; Module Settings ;
;;;;;;;;;;;;;;;;;;;

[Syslog]
define_syslog_variables = Off

[mail function]
; For Unix only. You may supply arguments as well (default: "sendmail -t -i").
sendmail_path = /usr/sbin/sendmail -t -i

[Java]
;java.class.path = .\php_java.jar
;java.home = c:\jdk
;java.library = c:\jdk\jre\bin\hotspot\jvm.dll
;java.library.path = .\

[SQL]
sql.safe_mode = Off

[ODBC]
;odbc.default_db = Not yet implemented
;odbc.default_user = Not yet implemented
;odbc.default_pw = Not yet implemented

; Allow or prevent persistent links.
odbc.allow_persistent = On

; Check that a connection is still valid before reuse.
odbc.check_persistent = On

; Maximum number of persistent links. -1 means no limit.
odbc.max_persistent = -1

; Maximum number of links (persistent + non-persistent). -1 means no limit.
odbc.max_links = -1

; Handling of LONG fields. Returns number of bytes to variables. 0 means
; passthru.
odbc.defaultlrl = 4096

[MySQL]
; Allow or prevent persistent links.
mysql.allow_persistent = On

; Maximum number of persistent links. -1 means no limit.
mysql.max_persistent = -1

; Maximum number of links (persistent + non-persistent). -1 means no limit.
mysql.max_links = -1

; Default port number for mysql_connect(). If unset, mysql_connect() will use
; the $MYSQL_TCP_PORT or the mysql-tcp entry in /etc/services or the
; compile-time value defined MYSQL_PORT (in that order). Win32 will only look
; at MYSQL_PORT.
mysql.default_port =

; Default socket name for local MySQL connects. If empty, uses the built-in
; MySQL defaults.
mysql.default_socket =

; Default host for mysql_connect() (doesn't apply in safe mode).
mysql.default_host =

; Default user for mysql_connect() (doesn't apply in safe mode).
mysql.default_user =

; Default password for mysql_connect() (doesn't apply in safe mode).
; Note that this is generally a *bad* idea to store passwords in this file.
; *Any* user with PHP access can run 'echo get_cfg_var("mysql.default_password")
; and reveal this password! And of course, any users with read access to this
; file will be able to reveal the password as well.
mysql.default_password =

; Maximum time (in secondes) for connect timeout. -1 means no limimt
mysql.connect_timeout = 60

; Trace mode. When trace_mode is active (=On), warnings for table/index scans and
; SQL-Erros will be displayed.
mysql.trace_mode = Off

[mSQL]
; Allow or prevent persistent links.
msql.allow_persistent = On

; Maximum number of persistent links. -1 means no limit.
msql.max_persistent = -1

; Maximum number of links (persistent+non persistent). -1 means no limit.
msql.max_links = -1

[PostgresSQL]
; Allow or prevent persistent links.
pgsql.allow_persistent = On

; Detect broken persistent links always with pg_pconnect(). Need a little overhead.
pgsql.auto_reset_persistent = Off

; Maximum number of persistent links. -1 means no limit.
pgsql.max_persistent = -1

; Maximum number of links (persistent+non persistent). -1 means no limit.
pgsql.max_links = -1

; Ignore PostgreSQL backends Notice message or not.
pgsql.ignore_notice = 0

; Log PostgreSQL backends Noitce message or not.
; Unless pgsql.ignore_notice=0, module cannot log notice message.
pgsql.log_notice = 0

[Sybase]
; Allow or prevent persistent links.
sybase.allow_persistent = On

; Maximum number of persistent links. -1 means no limit.
sybase.max_persistent = -1

; Maximum number of links (persistent + non-persistent). -1 means no limit.
sybase.max_links = -1

;sybase.interface_file = "/usr/sybase/interfaces"

; Minimum error severity to display.
sybase.min_error_severity = 10

; Minimum message severity to display.
sybase.min_message_severity = 10

; Compatability mode with old versions of PHP 3.0.
sybase.compatability_mode = Off

[Sybase-CT]
; Allow or prevent persistent links.
sybct.allow_persistent = On

; Maximum number of persistent links. -1 means no limit.
sybct.max_persistent = -1

; Maximum number of links (persistent + non-persistent). -1 means no limit.
sybct.max_links = -1

; Minimum server message severity to display.
sybct.min_server_severity = 10

; Minimum client message severity to display.
sybct.min_client_severity = 10

[dbx]
; returned column names can be converted for compatibility reasons
; possible values for dbx.colnames_case are
; "unchanged" (default, if not set)
; "lowercase"
; "uppercase"
; the recommended default is either upper- or lowercase, but
; unchanged is currently set for backwards compatibility
dbx.colnames_case = "unchanged"

[bcmath]
; Number of decimal digits for all bcmath functions.
bcmath.scale = 0

[browscap]
;browscap = extra/browscap.ini

[Informix]
; Default host for ifx_connect() (doesn't apply in safe mode).
ifx.default_host =

; Default user for ifx_connect() (doesn't apply in safe mode).
ifx.default_user =

; Default password for ifx_connect() (doesn't apply in safe mode).
ifx.default_password =

; Allow or prevent persistent links.
ifx.allow_persistent = On

; Maximum number of persistent links. -1 means no limit.
ifx.max_persistent = -1

; Maximum number of links (persistent + non-persistent). -1 means no limit.
ifx.max_links = -1

; If on, select statements return the contents of a text blob instead of its id.
ifx.textasvarchar = 0

; If on, select statements return the contents of a byte blob instead of its id.
ifx.byteasvarchar = 0

; Trailing blanks are stripped from fixed-length char columns. May help the
; life of Informix SE users.
ifx.charasvarchar = 0

; If on, the contents of text and byte blobs are dumped to a file instead of
; keeping them in memory.
ifx.blobinfile = 0

; NULL's are returned as empty strings, unless this is set to 1. In that case,
; NULL's are returned as string 'NULL'.
ifx.nullformat = 0

[Session]
; Handler used to store/retrieve data.
session.save_handler = files
session.save_path = /tmp

; Whether to use cookies.
session.use_cookies = 1

; Name of the session (used as cookie name).
session.name = PHPSESSID

; Initialize session on request startup.
session.auto_start = 0

; Lifetime in seconds of cookie or, if 0, until browser is restarted.
session.cookie_lifetime = 0

; The path for which the cookie is valid.
session.cookie_path = /

; The domain for which the cookie is valid.
session.cookie_domain =

; Handler used to serialize data. php is the standard serializer of PHP.
session.serialize_handler = php

session.gc_probability = 1
session.gc_divisor = 100

session.gc_maxlifetime = 1440

session.bug_compat_42 = 1
session.bug_compat_warn = 1

; Check HTTP Referer to invalidate externally stored URLs containing ids.
; HTTP_REFERER has to contain this substring for the session to be
; considered as valid.
session.referer_check =

; How many bytes to read from the file.
session.entropy_length = 0

; Specified here to create the session id.
session.entropy_file =

session.cache_limiter = nocache

; Document expires after n minutes.
session.cache_expire = 180

session.use_trans_sid = 0

url_rewriter.tags = "a=href,area=href,frame=src,input=src,form=,fieldse t="

[MSSQL]
; Allow or prevent persistent links.
mssql.allow_persistent = On

; Maximum number of persistent links. -1 means no limit.
mssql.max_persistent = -1

; Maximum number of links (persistent+non persistent). -1 means no limit.
mssql.max_links = -1

; Minimum error severity to display.
mssql.min_error_severity = 10

; Minimum message severity to display.
mssql.min_message_severity = 10

; Compatability mode with old versions of PHP 3.0.
mssql.compatability_mode = Off

; Connec timeout
;mssql.connect_timeout = 5

; Query timeout
;mssql.timeout = 60

; Valid range 0 - 2147483647. Default = 4096.
;mssql.textlimit = 4096

; Valid range 0 - 2147483647. Default = 4096.
;mssql.textsize = 4096

; Limits the number of records in each batch. 0 = all records in one batch.
;mssql.batchsize = 0

; Specify how datetime and datetim4 columns are returned
; On => Returns data converted to SQL server settings
; Off => Returns values as YYYY-MM-DD hh:mm:ss
;mssql.datetimeconvert = On

; Use NT authentication when connecting to the server
mssql.secure_connection = Off

; Specify max number of processes. Default = 25
;mssql.max_procs = 25

[Assertion]
; Assert(expr); active by default.
;assert.active = On

; Issue a PHP warning for each failed assertion.
;assert.warning = On

; Don't bail out by default.
;assert.bail = Off

; User-function to be called if an assertion fails.
;assert.callback = 0

; Eval the expression with current error_reporting(). Set to true if you want
; error_reporting(0) around the eval().
;assert.quiet_eval = 0

[Ingres II]
; Allow or prevent persistent links.
ingres.allow_persistent = On

; Maximum number of persistent links. -1 means no limit.
ingres.max_persistent = -1

; Maximum number of links, including persistents. -1 means no limit.
ingres.max_links = -1

; Default database (format: [node_id::]dbname[/srv_class]).
ingres.default_database =

; Default user.
ingres.default_user =

; Default password.
ingres.default_password =

[Verisign Payflow Pro]
; Default Payflow Pro server.
pfpro.defaulthost = "test-payflow.verisign.com"

; Default port to connect to.
pfpro.defaultport = 443

; Default timeout in seconds.
pfpro.defaulttimeout = 30

; Default proxy IP address (if required).
;pfpro.proxyaddress =

; Default proxy port.
;pfpro.proxyport =

; Default proxy logon.
;pfpro.proxylogon =

; Default proxy password.
;pfpro.proxypassword =

[Sockets]
; Use the system read() function instead of the php_read() wrapper.
sockets.use_system_read = On




11. if you run Apache and you have your own dedicated server or access to your httpd.conf (apache configuration file) can you post the values you have set for the following :

KeepAlive ON
MaxKeepAliveRequests 100
KeepAliveTimeout 15
MinSpareServers 5
MaxSpareServers 10
StartServers 5
MaxClients 150

12. what version of vB are you running ?

Vb 3.0.0 Gold with various vb.org hacks installed (basically all Forum Front enhancements). In particular the forum front page takes now quite a while to create.

Forum index.php:

Cached Example:
Page generated in 2.09790397 seconds (49.11% PHP - 50.89% MySQL) with 13 queries

Refreshed Example (F5):
Page generated in 5.32503009 seconds (12.95% PHP - 87.05% MySQL) with 13 queries

There might be an insane full table scan or something.

I installed another vb.org hack only a few days ago that displays the reputation comments as comments in posts, and apparently makes one query per post. So if there are 20 posts displayed in a thread, that's plus 20 queries. :D

However, I didn't notice any significant performance decrease or load increase with this one (the mySQL went a bit up, however):

Page generated in 1.29728003 seconds (75.45% PHP - 24.55% MySQL) with 36 queries

Upgrading PHP, mySQL or Apache is out of the question, by the way, due to Ensim Pro 3.5.19 limitations.

Thanks, Madam, for your time and for any optimization help you can provide. :)

AWS
Fri 7th May '04, 11:51am
Thanks, Madam, for your time and for any optimization help you can provide.

Eva2000 is a man named George.
You should upgrade to php 4.3.6 and upgrade mysql to 4.0.18.
Change my.cnf to:

port=3306
skip-locking
set-variable = max_connections=300
set-variable = key_buffer=32M
set-variable = max_allowed_packet=16M
set-variable = sort_buffer=2M
set-variable = record_buffer=2M
set-variable = join_buffer=1M
set-variable = table_cache=1024
set-variable = thread_cache_size=64
set-variable = wait_timeout=1800
set-variable = connect_timeout=10
set-variable = max_connect_errors=10
set-variable = myisam_sort_buffer_size=64M

[myisamchk]
set-variable = key_buffer=32M
set-variable = sort_buffer=32M
set-variable = read_buffer=2M
set-variable = write_buffer=2M


That should do it. Eva can check it to make sure.

eva2000
Fri 7th May '04, 2:35pm
actually if he upgrades mysql to 4.0.18 he should NOT use that my.cnf as it doesn't make use of the query caching ;)

you should really upgrade

1. mysql to 4.0.18
2. upgrade php to 4.3.6
3. if you use mysql 4.x use below /etc/my.cnf and restart mysql

[mysqld]
max_connections = 500
key_buffer = 16M
myisam_sort_buffer_size = 64M
join_buffer_size = 1M
read_buffer_size = 1M
sort_buffer_size = 2M
table_cache = 1024
thread_cache_size = 64
wait_timeout = 1800
connect_timeout = 10
max_allowed_packet = 16M
max_connect_errors = 10
query_cache_limit = 1M
query_cache_size = 32M
query_cache_type = 1
skip-innodb

[mysqld_safe]
open_files_limit = 8192

[mysqldump]
quick
max_allowed_packet = 16M

[myisamchk]
key_buffer = 64M
sort_buffer = 64M
read_buffer = 16M
write_buffer = 16M

if you use mysql 3.23.x use below /etc/my.cnf and restart mysql

[mysqld]
set-variable = max_connections=500
set-variable = key_buffer=16M
set-variable = myisam_sort_buffer_size=64M
set-variable = join_buffer=1M
set-variable = record_buffer=2M
set-variable = sort_buffer=2M
set-variable = table_cache=1024
set-variable = thread_cache_size=64
set-variable = wait_timeout=1800
set-variable = connect_timeout=10
set-variable = max_allowed_packet=16M
set-variable = max_connect_errors=10

[safe_mysqld]
open_files_limit=8192

[mysqldump]
quick
set-variable = max_allowed_packet=16M

[myisamchk]
set-variable = key_buffer=64M
set-variable = sort_buffer=64M
set-variable = read_buffer=16M
set-variable = write_buffer=16M

Njörd Eriksson
Fri 7th May '04, 7:29pm
Eva2000 is a man named George.
Ah, sorry for that. He is my hero anyway:

Forum index.php:
Page generated in 1.49054790 seconds (58.94% PHP - 41.06% MySQL) with 13 queries

Same thread (20 posts):
Page generated in 0.91893792 seconds (79.21% PHP - 20.79 MySQL) with 36 queries

MySQL went down, and it's significantly faster, in particular the Forum Home. :)

actually if he upgrades mysql to 4.0.18 he should use that my.cnf as it doesn't make use of the query caching ;)

you should really upgrade

1. mysql to 4.0.18
2. upgrade php to 4.3.6
3. if you use mysql 4.x use below /etc/my.cnf and restart mysql Would it make a big difference, you think? And why? :confused:

I'd love to upgrade; I just have to wait another few weeks until my dedicated server provider gets the Linux Enterprise & Ensim Pro 3.7 mirror (which comes with Apache 2, MySQL 4, and support for PHP 5).

I tried to upgrade to PHP 5 myself with the current Ensim Pro 3.5, and all that happened was that phpMyAdmin and SquirrelMail (Webmail) got messed up on the whole server. PHP errors ... took me days to fix it ... after inquiry with the Ensim support, they told me that Apache 2 and MySQL 4 is not compatible with Ensim Pro 3.5 either, and advised me to upgrade to Ensim Pro 3.7.

That means then that I'll have to swap my OS, too, as 3.7 doesn't run on Linux 7, just on Linux Enterprise.

I slowly but surely begin to fathom why many experts consider Ensim a horror ... :eek:

But it's very nice at the end-user level ... so I guess I'll stick with it.

if you use mysql 3.23.x use below /etc/my.cnf and restart mysql Worked great ... thanks a lot, George and AWS. ;)

Njörd Eriksson
Fri 7th May '04, 8:20pm
if you use mysql 3.23.x use below /etc/my.cnf and restart mysql I unfortunately have to correct myself. The suggested changes initiated eventually a swapping process, absolutely killing the server.

11:02pm up 3 days, 6:20, 1 user, load average: 65.85, 50.99, 25.49
373 processes: 364 sleeping, 3 running, 6 zombie, 0 stopped
CPU states: 10.4% user, 7.5% system, 0.0% nice, 82.0% idle
Mem: 505848K av, 498300K used, 7548K free, 0K shrd, 1504K buff
Swap: 2040244K av, 270712K used, 1769532K free 23764K cached

Is there a way to avoid this? :)

Njörd Eriksson
Fri 7th May '04, 9:55pm
Seems that I'm actually getting great server loads and forum speeds if there is no swapping whatsoever. Maybe whenever my load goes over 3.00 that's caused by swapping? Should I consider to get more memory?

That's with 108 users in half an hour (timeout 1800), and the old MySQL settings:

12:51am up 1:18, 1 user, load average: 0.44, 0.75, 0.80
77 processes: 76 sleeping, 1 running, 0 zombie, 0 stopped
CPU states: 16.5% user, 4.7% system, 3.1% nice, 75.4% idle
Mem: 505848K av, 444580K used, 61268K free, 0K shrd, 22736K buff
Swap: 2040244K av, 0K used, 2040244K free 335168K cached

Forum Home index.php:
Page generated in 1.36944199 seconds (45.44% PHP - 54.56% MySQL) with 13 queries

Same Thread:
Page generated in 0.63764095 seconds (86.71% PHP - 13.29% MySQL) with 36 queries

eva2000
Sat 8th May '04, 2:25pm
the my.cnf changes were only after you upgraded to mysql 4.0.18 which is 3x times faster than 3.23.x and more efficient

if you're using the mysql 3.23.x my.cnf and getting swapping to disk, i'd conclude that

1. you need the my.cnf changes to ensure mysql server is performing optimally
2. that if you need ram upgrade to ensure that #1 is met

or you'd need to run the settings longing and find out exactly what is causing the ram swapping i.e cron jobs for log rotation of very large log files i.e. if you had a 500MB log file which needs rotating and you already using 300-400/512MB of ram, you'd end up swapping to disk when cron accesses that 500MB long

Njörd Eriksson
Sun 9th May '04, 5:32pm
the my.cnf changes were only after you upgraded to mysql 4.0.18 which is 3x times faster than 3.23.x and more efficient

if you're using the mysql 3.23.x my.cnf and getting swapping to disk, i'd conclude that

1. you need the my.cnf changes to ensure mysql server is performing optimally
2. that if you need ram upgrade to ensure that #1 is met

or you'd need to run the settings longing and find out exactly what is causing the ram swapping i.e cron jobs for log rotation of very large log files i.e. if you had a 500MB log file which needs rotating and you already using 300-400/512MB of ram, you'd end up swapping to disk when cron accesses that 500MB long
Thanks for your help. What you say makes absolutely sense. :)