Jump to content


- - - - -

The query time of board index


  • Please log in to reply
12 replies to this topic

#1 Aeolus

Aeolus

    Programmer

  • IM Supporters
  • PipPipPipPipPipPip
  • 416 posts
  • Location:Taiwan
  • IPB Version:v3.1.x
Contributor

Posted 15 August 2010 - 11:52 PM

My time has a little higher than Invisionmodding.

My site
Attached File  query_time01.JPG   4.83K   0 downloads

Invisionmodding
Attached File  query_time00.JPG   4.32K   0 downloads

How to check and improve my servers' efficiency in order to decrease the time?

Thanks.

#2 Martin

Martin

    But but, it's not only only!

  • Management
  • PipPipPipPipPipPipPipPipPipPip
  • 7,081 posts
  • Location:Hammerfest, Norway
  • Real Name:Martin Aronsen
  • IPB Version:v3.2.x
Contributor

Posted 16 August 2010 - 12:11 AM

There's little you can do if you're on a shared hosting plan. If you want to do changes that affects the load time, that will involve tweaking Apache and MySQL, which you probably don't have access too.

One thing you can do is reduce the number of hooks. Normally hooks don't add much to the page generation time, but if you have your board stuffed with hooks, it will end up affecting it after all.
Also check if your host have installed some sort of cache engine that IP.Board supports. Check here to see how to enable it.

Another thing is your skin CSS. Per default, the CSS is not set to cache to a file. As it is right now, it's pulled from the database instead, and due to the size of that, it might drag the performance down.

Setting the sessions table engine to "MEMORY/HEAP" will also affect performance.


Without knowing anything about what sort of hosting you have, and what you've already done, it's difficult to give precise suggestions on what you can do.

#3 Aeolus

Aeolus

    Programmer

  • IM Supporters
  • PipPipPipPipPipPip
  • 416 posts
  • Location:Taiwan
  • IPB Version:v3.1.x
Contributor

Posted 16 August 2010 - 02:48 PM

Actually,I built my own www server at home, so I have 100% access . ^_^

After reading your good information, i did these some method of them, but it didn't change present situation.

I did:
(1)Add eAccelerator and memcache to my server and add these codes to conf_global.php
$INFO['use_eaccelerator'] = '1';
$INFO['use_memcache'] = '1';
$INFO['memcache_server_1'] = '127.0.0.1';
$INFO['memcache_port_1'] = 'my_port_number';
and got no error message.

(2)Setting the CSS to cache to a file => Yes , from ACP.

(3)Setting the sessions table engine to MEMORY.


I think i should find something and study hard about Apache and MySQL.

Now i install a new testing forum that has only a few categories and forums.

And its query time is low.
Attached File  query_time.png   4.84K   0 downloads

Anyway, thanks so much.

#4 Martin

Martin

    But but, it's not only only!

  • Management
  • PipPipPipPipPipPipPipPipPipPip
  • 7,081 posts
  • Location:Hammerfest, Norway
  • Real Name:Martin Aronsen
  • IPB Version:v3.2.x
Contributor

Posted 16 August 2010 - 08:39 PM

You'll find lots of guides on how to tweak Apache and MySQL. Some will advise you to switch to LigHTTPD, but I found it a bit to featureless for IP.Board. Difficult to get proper friendly URLs, and some other things.
I would start off by using PHP in FastCGI mode (How to configure this depends on your distro. Do a Google search for "php apache fastcgi <distro>"). That way you constantly have 5-6 PHP processes open at all time, allowing Apache to choose one of them, instead of starting it on its own.
If this is a pure webserver, remove everything you don't need, such as X11 and any desktop manager (KDE, Gnome).

Using eAccelerator and Memcache is not good. These will try to work on top of each other, if not, just the first one will work (not sure how IP.Board handles this). Memcache is much faster than eAccelerator (if you have enough "umpf" in your server that is).

#5 Aeolus

Aeolus

    Programmer

  • IM Supporters
  • PipPipPipPipPipPip
  • 416 posts
  • Location:Taiwan
  • IPB Version:v3.1.x
Contributor

Posted 17 August 2010 - 01:31 AM

Thanks for your precious experience , it's useful for me.

I think i will still keep to ues debian + Apache + MySQL.

I also have a intranet server, and i had installed FastCgi also,but it had not seen the obvious improvement.

It's a long time for me to use windows os , so it's the transition period to ues X11 ,Gnome at present.

My Debian server had been installed with X11 and Gnome, maybe this is the reason.

But i disable X11 and gdm ordinary ,and enable it just when i want to copy a lot mount of files.

These are all my hooks, is it suitable?

Quote

ibProArcade v2 Games
Saves Score for v2games Mike Jun 21 2010 08:52 PM


Ad Code Sidebar
Displays ad code on the board index sidebar Invision Power Services, Inc. 3 weeks ago

Unread Notifications
Shows unread notifications on the board index Invision Power Services, Inc 3 weeks ago

(IM) Closing Reason as Post Invision Modding Oct 20 2009 10:22 AM

(IM) Board Panel
Shows a panel of useful information at the top of the Board Index Michael McCune Oct 07 2009 04:07 PM

(e$30) Custom Sidebar Blocks
Create as many custom content blocks for your board's index sidebar. For use with the (e$30) Custom Sidebar Blocks Application emoney Sep 11 2009 03:30 PM

Recent Topics
Adds a list of recent topics to the board index Invision Power Services, Inc 3 weeks ago

(e$30) My Header Links Extended
Adds the ability to show a few more member dropdown links in the header emoney Jun 11 2010 10:09 PM

Status Updates
Displays the last 10 status updates from members Invision Power Services, Inc 3 weeks ago

(IM) Global Forum Message
Shows a message at the top of your forum to selected groups, on selected pages Michael McCune Sep 07 2009 11:20 PM

Simple Points Language
This is only used to add some lang bits for the simple points system. Nothing more. BASHERS33 Aug 25 2009 06:18 AM

Today's Top Posters
Displays the top posters from the past 24 hours on the board index Invision Power Services, Inc Jun 08 2010 10:13 PM

(IM) Members Online Today
Shows a list of which members have been online that day Michael McCune Aug 15 2009 09:10 AM

Board Index Watched Content
Shows watched forums and topics on the board index Invision Power Services, Inc 3 weeks ago


#6 Martin

Martin

    But but, it's not only only!

  • Management
  • PipPipPipPipPipPipPipPipPipPip
  • 7,081 posts
  • Location:Hammerfest, Norway
  • Real Name:Martin Aronsen
  • IPB Version:v3.2.x
Contributor

Posted 17 August 2010 - 01:55 AM

That's not an enormous amount of hooks. Should require much to run those.

As I said, look around the web for guides on how to do performance tweaks in Apache, that should kick things of nicely.
On my VPS I went from 0.5 on a vanilla LAMP install, to 0.04 after lots of tweaking here and there. It's a while since I did those, so can't say exactly what I did.

#7 Aeolus

Aeolus

    Programmer

  • IM Supporters
  • PipPipPipPipPipPip
  • 416 posts
  • Location:Taiwan
  • IPB Version:v3.1.x
Contributor

Posted 17 August 2010 - 01:57 PM

That's ok.
Thanks anyway.
I will keep looking for tweaking PHP and MySQL.

#8 leo11173

leo11173

    n00b

  • Members
  • Pip
  • 1 posts
  • Real Name:Léonard
  • IPB Version:v3.1.x

Posted 19 August 2010 - 11:49 AM

Quote

(1)Add eAccelerator and memcache

This will have no effect if your server donc support fcgi.

#9 Aeolus

Aeolus

    Programmer

  • IM Supporters
  • PipPipPipPipPipPip
  • 416 posts
  • Location:Taiwan
  • IPB Version:v3.1.x
Contributor

Posted 19 August 2010 - 03:23 PM

Thanks, leo11173

I also had tried what you said ,  eAccelerator with on fcgi, but no works.

After keeping to add a lot of forums into the test forum, the time goes up to 0.1181.

two Categories , four forums , three topics , one member, the time is
Attached File  query01.png   4.84K   0 downloads

Add more to five Categories, 37 forums, 15 topis and one member, the time is
Attached File  query02.png   9.35K   0 downloads

#10 Martin

Martin

    But but, it's not only only!

  • Management
  • PipPipPipPipPipPipPipPipPipPip
  • 7,081 posts
  • Location:Hammerfest, Norway
  • Real Name:Martin Aronsen
  • IPB Version:v3.2.x
Contributor

Posted 20 August 2010 - 12:06 AM

Can you post your Apache and MySQL configs, and specs on the server?

#11 Aeolus

Aeolus

    Programmer

  • IM Supporters
  • PipPipPipPipPipPip
  • 416 posts
  • Location:Taiwan
  • IPB Version:v3.1.x
Contributor

Posted 20 August 2010 - 02:37 AM

My Debian Server spec.

Quote

System hostname ipb.tw
Operating system Debian Linux 5.0
Kernel and CPU Linux 2.6.26-2-amd64 on x86_64
Processor information AMD Sempron™ Dual Core Processor 2100, 2 cores
Running processes 89
CPU load averages 0.75 (1 min) 0.92 (5 mins) 0.42 (15 mins)
CPU usage 0% user, 0% kernel, 0% IO, 100% idle
Real memory 1.72 GB total, 236.27 MB used
Virtual memory 2.13 GB total, 0 bytes used
Local disk space 56.93 GB total, 29.44 GB used
Package updates All installed packages are up to date

/etc/apache2/apache2.conf
#
# Based upon the NCSA server configuration files originally by Rob McCool.
#
# This is the main Apache server configuration file.  It contains the
# configuration directives that give the server its instructions.
# See http://httpd.apache.org/docs/2.2/ for detailed information about
# the directives.
#
# Do NOT simply read the instructions in here without understanding
# what they do.  They're here only as hints or reminders.  If you are unsure
# consult the online docs. You have been warned.  
#
# The configuration directives are grouped into three basic sections:
#  1. Directives that control the operation of the Apache server process as a
#	 whole (the 'global environment').
#  2. Directives that define the parameters of the 'main' or 'default' server,
#	 which responds to requests that aren't handled by a virtual host.
#	 These directives also provide default values for the settings
#	 of all virtual hosts.
#  3. Settings for virtual hosts, which allow Web requests to be sent to
#	 different IP addresses or hostnames and have them handled by the
#	 same Apache server process.
#
# Configuration and logfile names: If the filenames you specify for many
# of the server's control files begin with "/" (or "drive:/" for Win32), the
# server will use that explicit path.  If the filenames do *not* begin
# with "/", the value of ServerRoot is prepended -- so "/var/log/apache2/foo.log"
# with ServerRoot set to "" will be interpreted by the
# server as "//var/log/apache2/foo.log".
#

### Section 1: Global Environment
#
# The directives in this section affect the overall operation of Apache,
# such as the number of concurrent requests it can handle or where it
# can find its configuration files.
#

#
# ServerRoot: The top of the directory tree under which the server's
# configuration, error, and log files are kept.
#
# NOTE!  If you intend to place this on an NFS (or otherwise network)
# mounted filesystem then please read the LockFile documentation (available
# at <URL:http://httpd.apache.org/docs-2.1/mod/mpm_common.html#lockfile>);
# you will save yourself a lot of trouble.
#
# Do NOT add a slash at the end of the directory path.
#
ServerRoot "/etc/apache2"

#
# The accept serialization lock file MUST BE STORED ON A LOCAL DISK.
#
#<IfModule !mpm_winnt.c>
#<IfModule !mpm_netware.c>
LockFile /var/lock/apache2/accept.lock
#</IfModule>
#</IfModule>

#
# PidFile: The file in which the server should record its process
# identification number when it starts.
# This needs to be set in /etc/apache2/envvars
#
PidFile ${APACHE_PID_FILE}

#
# Timeout: The number of seconds before receives and sends time out.
#
TimeOut 200

#
# KeepAlive: Whether or not to allow persistent connections (more than
# one request per connection). Set to "Off" to deactivate.
#
KeepAlive on

#
# MaxKeepAliveRequests: The maximum number of requests to allow
# during a persistent connection. Set to 0 to allow an unlimited amount.
# We recommend you leave this number high, for maximum performance.
#
MaxKeepAliveRequests 100

#
# KeepAliveTimeout: Number of seconds to wait for the next request from the
# same client on the same connection.
#
KeepAliveTimeout 3

##
## Server-Pool Size Regulation (MPM specific)
## 

# prefork MPM
# StartServers: number of server processes to start
# MinSpareServers: minimum number of server processes which are kept spare
# MaxSpareServers: maximum number of server processes which are kept spare
# MaxClients: maximum number of server processes allowed to start
# MaxRequestsPerChild: maximum number of requests a server process serves
#<IfModule mpm_prefork_module> --- This is original by Aeolus
#	StartServers		  15
#	MinSpareServers	  10
#	MaxSpareServers	  20
#	MaxClients		  250
#	MaxRequestsPerChild   0
#</IfModule>
<IfModule mpm_prefork_module>
StartServers 2
MinSpareServers 3
MaxSpareServers 5
ServerLimit 16
MaxClients 16
MaxRequestsPerChild 400000
</IfModule>
# worker MPM
# StartServers: initial number of server processes to start
# MaxClients: maximum number of simultaneous client connections
# MinSpareThreads: minimum number of worker threads which are kept spare
# MaxSpareThreads: maximum number of worker threads which are kept spare
# ThreadsPerChild: constant number of worker threads in each server process
# MaxRequestsPerChild: maximum number of requests a server process serves
# <IfModule mpm_worker_module> --- Original by Aeolus
#	 StartServers		  2
#	 MaxClients		  150
#	 MinSpareThreads	  25
#	 MaxSpareThreads	  75 
#	 ThreadsPerChild	  25
#	 MaxRequestsPerChild   0
# </IfModule>
<IfModule mpm_worker_module>
	StartServers		  2
	MaxClients		   16
	MinSpareThreads	  16
	MaxSpareThreads	  75 
	ThreadsPerChild	  16
	MaxRequestsPerChild   400000
</IfModule>
# These need to be set in /etc/apache2/envvars
User ${APACHE_RUN_USER}
Group ${APACHE_RUN_GROUP}

#
# AccessFileName: The name of the file to look for in each directory
# for additional configuration directives.  See also the AllowOverride
# directive.
#

AccessFileName .htaccess

#
# The following lines prevent .htaccess and .htpasswd files from being 
# viewed by Web clients. 
#
<Files ~ "^\.ht">
	Order allow,deny
	Deny from all
</Files>

#
# DefaultType is the default MIME type the server will use for a document
# if it cannot otherwise determine one, such as from filename extensions.
# If your server contains mostly text or HTML documents, "text/plain" is
# a good value.  If most of your content is binary, such as applications
# or images, you may want to use "application/octet-stream" instead to
# keep browsers from trying to display binary files as though they are
# text.
#
DefaultType text/plain


#
# HostnameLookups: Log the names of clients or just their IP addresses
# e.g., www.apache.org (on) or 204.62.129.132 (off).
# The default is off because it'd be overall better for the net if people
# had to knowingly turn this feature on, since enabling it means that
# each client request will result in AT LEAST one lookup request to the
# nameserver.
#
HostnameLookups Off

# ErrorLog: The location of the error log file.
# If you do not specify an ErrorLog directive within a <VirtualHost>
# container, error messages relating to that virtual host will be
# logged here.  If you *do* define an error logfile for a <VirtualHost>
# container, that host's errors will be logged there and not here.
#
ErrorLog /var/log/apache2/error.log

#
# LogLevel: Control the number of messages logged to the error_log.
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
#
LogLevel warn

# Include module configuration:
Include /etc/apache2/mods-enabled/*.load
Include /etc/apache2/mods-enabled/*.conf

# Include all the user configurations:
Include /etc/apache2/httpd.conf

# Include ports listing
Include /etc/apache2/ports.conf

#
# The following directives define some format nicknames for use with
# a CustomLog directive (see below).
# If you are behind a reverse proxy, you might want to change %h into %{X-Forwarded-For}i
#
LogFormat "%v:%p %h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %b" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent

#
# Define an access log for VirtualHosts that don't define their own logfile
CustomLog /var/log/apache2/other_vhosts_access.log vhost_combined

#
# Customizable error responses come in three flavors:
# 1) plain text 2) local redirects 3) external redirects
#
# Some examples:
#ErrorDocument 500 /error_msg/error500.html
#ErrorDocument 404 /error_msg/error404.html
#ErrorDocument 404 "/cgi-bin/missing_handler.pl"
#ErrorDocument 402 http://www.example.com/subscription_info.html
#

#
# Putting this all together, we can internationalize error responses.
#
# We use Alias to redirect any /error/HTTP_<error>.html.var response to
# our collection of by-error message multi-language collections.  We use 
# includes to substitute the appropriate text.
#
# You can modify the messages' appearance without changing any of the
# default HTTP_<error>.html.var files by adding the line:
#
#   Alias /error/include/ "/your/include/path/"
#
# which allows you to create your own set of files by starting with the
# /usr/share/apache2/error/include/ files and copying them to /your/include/path/, 
# even on a per-VirtualHost basis.  The default include files will display
# your Apache version number and your ServerAdmin email address regardless
# of the setting of ServerSignature.
#
# The internationalized error documents require mod_alias, mod_include
# and mod_negotiation.  To activate them, uncomment the following 30 lines.

#	Alias /error/ "/usr/share/apache2/error/"
#
#	<Directory "/usr/share/apache2/error">
#		AllowOverride None
#		Options IncludesNoExec
#		AddOutputFilter Includes html
#		AddHandler type-map var
#		Order allow,deny
#		Allow from all
#		LanguagePriority en cs de es fr it nl sv pt-br ro
#		ForceLanguagePriority Prefer Fallback
#	</Directory>
#
#	ErrorDocument 400 /error/HTTP_BAD_REQUEST.html.var
#	ErrorDocument 401 /error/HTTP_UNAUTHORIZED.html.var
#	ErrorDocument 403 /error/HTTP_FORBIDDEN.html.var
# ErrorDocument 403 /error_msg/error403.html
#	ErrorDocument 404 /error/HTTP_NOT_FOUND.html.var
#	ErrorDocument 405 /error/HTTP_METHOD_NOT_ALLOWED.html.var
#	ErrorDocument 408 /error/HTTP_REQUEST_TIME_OUT.html.var
#	ErrorDocument 410 /error/HTTP_GONE.html.var
#	ErrorDocument 411 /error/HTTP_LENGTH_REQUIRED.html.var
#	ErrorDocument 412 /error/HTTP_PRECONDITION_FAILED.html.var
#	ErrorDocument 413 /error/HTTP_REQUEST_ENTITY_TOO_LARGE.html.var
#	ErrorDocument 414 /error/HTTP_REQUEST_URI_TOO_LARGE.html.var
#	ErrorDocument 415 /error/HTTP_UNSUPPORTED_MEDIA_TYPE.html.var
#ErrorDocument 500 /error_msg/error500.html
#	ErrorDocument 501 /error/HTTP_NOT_IMPLEMENTED.html.var
#	ErrorDocument 502 /error/HTTP_BAD_GATEWAY.html.var
#	ErrorDocument 503 /error/HTTP_SERVICE_UNAVAILABLE.html.var
#	ErrorDocument 506 /error/HTTP_VARIANT_ALSO_VARIES.html.var



# Include of directories ignores editors' and dpkg's backup files,
# see README.Debian for details.

# Include generic snippets of statements
Include /etc/apache2/conf.d/

# Include the virtual host configurations:
Include /etc/apache2/sites-enabled/

<Directory "/var/www/zapcupsd">
	   Order allow,deny
	   Allow from all
	   AllowOverride None
	   Options ExecCGI
	   AddHandler cgi-script .cgi
</Directory>

/etc/apache2/httpd.conf
<IfModule mod_evasive20.c>
	DOSHashTableSize	3097
	DOSPageCount		2
	DOSSiteCount		50
	DOSPageInterval	 1
	DOSSiteInterval	 1
	DOSBlockingPeriod   10
	DOSLogDir	"/var/lock/mod_evasive"
</IfModule>

/etc/apache2/sites-available
<VirtualHost *:80>
	ServerAdmin webmaster@localhost
	DocumentRoot /var/www/
	<Directory />
		Options FollowSymLinks
		AllowOverride All
	</Directory>
	<Directory /var/www/>
		Options Indexes FollowSymLinks MultiViews
		AllowOverride All
		Order allow,deny
		allow from all
	</Directory>
	ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
	<Directory "/usr/lib/cgi-bin">
		AllowOverride All
		Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
		Order allow,deny
		Allow from all
	</Directory>
	ErrorLog /var/log/apache2/error.log
	# Possible values include: debug, info, notice, warn, error, crit,
	# alert, emerg.
	LogLevel warn
SetEnvIf Remote_Addr "74\.125\.158\.80" dontlog
SetEnvIf Remote_Addr "74\.125\.158\.81" dontlog
SetEnvIf Remote_Addr "74\.125\.158\.82" dontlog
SetEnvIf Remote_Addr "174\.133\.177\.66" dontlog
SetEnvIf Remote_Addr "205\.209\.170\.34" dontlog
SetEnvIf Remote_Addr "72\.43\.5\.141" dontlog
SetEnvIf Remote_Addr "119\.235\.237\.141" dontlog
SetEnvIf Remote_Addr "221\.194\.137\.84" dontlog
SetEnvIf Remote_Addr "221\.194\.136\.39" dontlog
SetEnvIf Remote_Addr "208\.115\.111\.246" dontlog
SetEnvIf Remote_Addr "221\.194\.136\.39" dontlog
SetEnvIf Remote_Addr "221\.194\.136\.43" dontlog
SetEnvIf Remote_Addr "221\.194\.136\.60" dontlog
SetEnvIf Remote_Addr "221\.194\.136\.234" dontlog
SetEnvIf Remote_Addr "221\.194\.136\.235" dontlog
SetEnvIf Remote_Addr "221\.194\.136\.238" dontlog
SetEnvIf Remote_Addr "221\.194\.136\.241" dontlog
SetEnvIf Remote_Addr "221\.194\.136\.245" dontlog
SetEnvIf Remote_Addr "221\.194\.136\.247" dontlog
SetEnvIf Remote_Addr "221\.194\.136\.246" dontlog
SetEnvIf Remote_Addr "216\.129\.119\.40" dontlog
SetEnvIf Remote_Addr "66\.249\.65\." dontlog
SetEnvIf Remote_Addr "66\.249\.67\." dontlog
SetEnvIf Remote_Addr "66\.249\.68\." dontlog
SetEnvIf Remote_Addr "66\.249\.69\." dontlog
SetEnvIf Remote_Addr "66\.249\.71\." dontlog
SetEnvIf Remote_Addr "127\.0\.0\.1" dontlog
SetEnvIf Remote_Addr "10\.0\." dontlog
SetEnvIf Remote_Addr "72\.30\." dontlog
SetEnvIf Remote_Addr "74\.6\." dontlog
SetEnvIf Remote_Addr "65\.52\." dontlog
SetEnvIf Remote_Addr "65\.53\." dontlog
SetEnvIf Remote_Addr "65\.54\." dontlog
SetEnvIf Remote_Addr "65\.55\." dontlog
#Yahoo Search---SetEnvIf Remote_Addr "67\.195\." dontlog
SetEnvIf Remote_Addr "123\.125\.66\." dontlog
SetEnvIf Remote_Addr "65\.55\.3\.196" dontlog
SetEnvIf Remote_Addr "65\.55\.207\.50" dontlog
SetEnvIf Remote_Addr "65\.55\.106\.135" dontlog
SetEnvIf Remote_Addr "220\.135\.213\.158" dontlog
SetEnvIf Remote_Addr "192\.168\.10\.112" dontlog
SetEnvIf Remote_Addr "220\.181\.7\." dontlog
SetEnvIf Remote_Addr "61\.135\.168\." dontlog
SetEnvIf Remote_Addr "220\.115\.111\.246" dontlog
SetEnvIf Remote_Addr "::1" dontlog
SetEnvIf Referer google\.com dontlog
SetEnvIf Referer tw\.search\.yahoo\.com dontlog
SetEnvIf Referer ^.*Baidu.* dontlog
SetEnvIf User-Agent "Yeti\/" dontlog
SetEnvIf User-Agent help\.yahoo\.com dontlog
SetEnvIf User-Agent ^.*Yandex.* dontlog
SetEnvIf User-Agent ^Yepi dontlog
SetEnvIf User-Agent ^.*CollapsarWEB.* dontlog
SetEnvIf User-Agent ^.*Twiceler.* dontlog
SetEnvIf User-Agent ^.*sun4u.* dontlog
SetEnvIf User-Agent "^.*dex\ Bot\ Search.*" dontlog
SetEnvIf User-Agent ^.*msnbot.* dontlog
SetEnvIf User-Agent ^.*majestic12.* dontlog
SetEnvIf User-Agent "spider.htm" dontlog
SetEnvIf User-Agent "help.html" dontlog
SetEnvIf User-Agent ^Sosospider dontlog
SetEnvIf User-Agent ^.*Purebot.* dontlog
SetEnvIf User-Agent ^.*YoudaoBot.* dontlog
SetEnvIf Request_URI contact\.php$ dontlog
SetEnvIf Request_URI "^/robots\.txt$" dontlog
SetEnvIf Request_URI "^/forum/public/style_images/star/04CANCER\.gif$" dontlog
SetEnvIf Request_URI "^/forum/public/style_images/star/04CANCER\.gif$" dontlog
SetEnvIf Request_URI "^/forum/public/style_extra/post_icons/$\.gif$" dontlog
SetEnvIf Request_URI  "\.css\ HTTP/1\.0" dontlog
SetEnvIf Request_URI "^/$/styx_wmp9_skyblue2/images/$\.gif$" dontlog
SetEnvIf Request_URI "^.*\.css.*" dontlog
SetEnvIf Request_URI ^.*ipb_ie.css.* dontlog
SetEnvIf Request_URI ^.*prettify.css.* dontlog
SetEnvIf Request_URI "favicon.ico" dontlog
SetEnvIf Request_URI "google_adsense_script.html" dontlog
SetEnvIf Request_URI player\.html dontlog
SetEnvIf Request_URI "$bot\.html" dontlog
SetEnvIf Request_URI "^/chinese\.php$" dontlog
SetEnvIf Request_URI ^.*2007\.htm.* dontlog
SetEnvIf Request_URI "^/english\.php$" dontlog
SetEnvIf Request_URI ^.*2007e\.htm.* dontlog
SetEnvIf Request_URI "^/special\.css$" dontlog
SetEnvIf Request_URI "940818_2.asx" dontlog
SetEnvIf Request_URI "\.gif$" dontlog
SetEnvIf Request_URI "\.js$" dontlog
SetEnvIf Request_URI "msnbot" dontlog
SetEnvIf Request_URI "\.jpg$" dontlog
SetEnvIf Request_URI "\.JPG$" dontlog
SetEnvIf Request_URI "\.bmp$" dontlog
SetEnvIf Request_URI "\.BMP$" dontlog
SetEnvIf Request_URI "\.jpeg$" dontlog
SetEnvIf Request_URI "\.JPEG$" dontlog
SetEnvIf Request_URI "\.png$" dontlog
SetEnvIf Request_URI "\.swf$" dontlog
SetEnvIf Request_URI "\.SWF$" dontlog
SetEnvIf Request_URI "\.CSS$" dontlog
SetEnvIf Request_URI ^.*\.css$ dontlog
SetEnvIf Request_URI "\.js$" dontlog
SetEnvIf Request_URI "\.JS$" dontlog
SetEnvIf Request_URI "\.wma$" dontlog
SetEnvIf Request_URI "\.mp3$" dontlog
SetEnvIf Request_URI "\.Wma$" dontlog
SetEnvIf Request_URI "\.ico$" dontlog
CustomLog /var/log/apache2/access.log combined env=!dontlog
#A little record information---CustomLog /var/log/apache2/access.log common env=!dontlog
	Alias /doc/ "/usr/share/doc/"
	<Directory "/usr/share/doc/">
		Options Indexes MultiViews FollowSymLinks
		AllowOverride All
		Order deny,allow
		Deny from all
		Allow from 127.0.0.0/255.0.0.0 ::1/128
	</Directory>
SetEnvIfNoCase Referer "^http://ipb\.tw/" ref=1
SetEnvIfNoCase Referer "^http://220\.135\.213\.158/" ref=1
SetEnvIfNoCase Referer "^http://127\.0\.0\.1/" ref=1
SetEnvIfNoCase Referer "^http://192\.168\.1\.113/" ref=1
SetEnvIfNoCase Referer "^http://192\.168\.10\.112/" ref=1
SetEnvIfNoCase Referer "^http://140\.138\.145\.240/" ref=1
SetEnvIfNoCase Referer "^http://www\.ubuntu-tw\.org/" ref=1
SetEnvIfNoCase Referer "^http://moto\.debian\.org\.tw/" ref=1
SetEnvIfNoCase Referer "^http://community\.invisionpower\.com/" ref=1
SetEnvIfNoCase Referer "^http://www\.ibparcade\.com/" ref=1
SetEnvIfNoCase Referer "^http://www\.invisionmodding\.com/" ref=1
<FilesMatch "\.(JPG|GIF|PNG|CSS|JPEG|MPG|MPEG|jpg|gif|png|css|jpeg|mpg|mpeg)$">
Order allow,deny
Allow from env=ref
</FilesMatch>
</VirtualHost>

/etc/mysql/my.cnf
#
# 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
# http://dev.mysql.com/doc/mysql/en/server-system-variables.html

# 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.
[client]
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.
[mysqld_safe]
socket		= /var/run/mysqld/mysqld.sock
nice		= 0

[mysqld]
#
# * 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
language	= /usr/share/mysql/english
skip-external-locking
skip-locking
#
# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
bind-address		= 127.0.0.1
#
# * Fine Tuning
#
key_buffer		= 16k
max_allowed_packet	= 1M
thread_stack		= 64K
thread_cache_size	= 4
sort_buffer = 64K
net_buffer_length = 2K
# This replaces the startup script and checks MyISAM tables if needed
# the first time they are touched
myisam-recover		= BACKUP
#max_connections		= 100
#table_cache			= 64
#thread_concurrency	 = 10
#
# * Query Cache Configuration
#
query_cache_limit	   = 1M
query_cache_size		= 16M
query_cache_type=1
#
# * Logging and Replication
#
# Both location gets rotated by the cronjob.
# Be aware that this log type is a performance killer.
#log		= /var/log/mysql/mysql.log
#
# Error logging goes to syslog. This is a Debian improvement :)
#
# Here you can see queries with especially long duration
log_slow_queries	= /var/log/mysql/mysql-slow.log
#long_query_time = 2
long_query_time = 5
#log-queries-not-using-indexes
#
# 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
#binlog_do_db		= include_database_name
#binlog_ignore_db	= include_database_name
#
# * BerkeleyDB
#
# Using BerkeleyDB is now discouraged as its support will cease in 5.1.12.
skip-bdb
#
# * 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!
# You might want to disable InnoDB to shrink the mysqld process by circa 100MB.
skip-innodb
#
# * Security Features
#
# Read the manual, too, if you want chroot!
# chroot = /var/lib/mysql/
#
# For generating SSL certificates I recommend the OpenSSL GUI "tinyca".
#
# ssl-ca=/etc/mysql/cacert.pem
# ssl-cert=/etc/mysql/server-cert.pem
# ssl-key=/etc/mysql/server-key.pem

[mysqldump]
quick
quote-names
max_allowed_packet	= 16M

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

[isamchk]
key_buffer		= 16M

#
# * NDB Cluster
#
# See /usr/share/doc/mysql-server-*/README.Debian for more information.
#
# The following configuration is read by the NDB Data Nodes (ndbd processes)
# not from the NDB Management Nodes (ndb_mgmd processes).
#
# [MYSQL_CLUSTER]
# ndb-connectstring=127.0.0.1


#
# * 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/


Thanks.

#12 Martin

Martin

    But but, it's not only only!

  • Management
  • PipPipPipPipPipPipPipPipPipPip
  • 7,081 posts
  • Location:Hammerfest, Norway
  • Real Name:Martin Aronsen
  • IPB Version:v3.2.x
Contributor

Posted 20 August 2010 - 11:03 AM

You have plenty of memory available, so you should definitely increase the MySQL key_buffer to something greater than 16k - which is incredibly low. On my 512MB VPS I have that set to 16M, but as you have 2GB of memory, that can at least be set to 200M.
This topic at TAZ helps you know what the various directives in my.cnf means.

In Apache, have you disabled unused modules? You can do that by removing *.load and *.conf from /etc/apache2/mods-enabled (the files in here are shortcuts to /etc/apache2/mods-available).

#13 Aeolus

Aeolus

    Programmer

  • IM Supporters
  • PipPipPipPipPipPip
  • 416 posts
  • Location:Taiwan
  • IPB Version:v3.1.x
Contributor

Posted 20 August 2010 - 01:56 PM

View PostMartin, on 20 August 2010 - 11:03 AM, said:

You have plenty of memory available, so you should definitely increase the MySQL key_buffer to something greater than 16k - which is incredibly low. On my 512MB VPS I have that set to 16M, but as you have 2GB of memory, that can at least be set to 200M.
This topic at TAZ helps you know what the various directives in my.cnf means.

In Apache, have you disabled unused modules? You can do that by removing *.load and *.conf from /etc/apache2/mods-enabled (the files in here are shortcuts to /etc/apache2/mods-available).

Setting key_buffer to 200M.

These are enable mods, which one that i can disable.

Quote

core_module (static)
log_config_module (static)
logio_module (static)
mpm_prefork_module (static)
http_module (static)
so_module (static)
alias_module (shared)
auth_basic_module (shared)
authn_file_module (shared)
authopenid_module (shared)
authz_default_module (shared)
authz_groupfile_module (shared)
authz_host_module (shared)
authz_user_module (shared)
autoindex_module (shared)
cache_module (shared)
cgi_module (shared)
deflate_module (shared)
dir_module (shared)
env_module (shared)
mem_cache_module (shared)
mime_module (shared)
evasive20_module (shared)
negotiation_module (shared)
php5_module (shared)
rewrite_module (shared)
setenvif_module (shared)
ssl_module (shared)
status_module (shared)

Thanks.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users