落伍者站长论坛's Archiver

大灰杨 发表于 2005-4-24 23:30

【问题求教】双服务器双IP该怎么配置最好?

两台服务器里有一台相对差点的,都是在一个机房,百M共享

在线1千2不到就很容易访问不了,郁闷~


请高手不吝指点!!:(

阿新 发表于 2005-4-24 23:49

没看明白

herobei 发表于 2005-4-25 00:38

你这样提问大家没法回答您。具体把你的情况介绍以下。如软硬件培植,服务内容具体的系统负载提示等等贴出来。

大灰杨 发表于 2005-4-25 01:42

配置

服务器 1 双cpu 4G内存
服务器2 单cpu 2G内存

都是xero内存,系统是redhat AS3

现在问题这样,如果做2台服务器之间的web集群效率更高,有没有好的方案

herobei 发表于 2005-4-25 10:46

你可以做个dns负载均衡,比较简单效果也不错。
[url]www.yourname.com[/url]  in cname realserver.youname.com
reaserver.youname.com in a  ip1
reaserver.youname.com in A ip2
服务器要求服务的内容一致即可。
如果要做lvs 均衡,[url]http://www.linuxvirtualserver.org/whatis.html[/url]。
其他方案:[url]http://www.csm.ornl.gov/pvm/pvm_home.html[/url]
[url]http://www-unix.mcs.anl.gov/mpi/mpich/docs/faq.htm[/url]

大灰杨 发表于 2005-4-25 15:42

dns好像不是我做的吧??需要域名转发做的?

lvs最少机器需要3台,一台做load balance,我只有2台

[[i] Last edited by 大灰杨 on 2005-4-25 at 15:46 [/i]]

jglzxs 发表于 2005-4-25 17:21

做个APACHE集群

大灰杨 发表于 2005-4-25 17:44

怎么做apache集群??

crazy 发表于 2005-4-25 19:18

这样的机器论坛在线1千2就访问不了啦?日哦!基本上不可能的

[[i] Last edited by crazy on 2005-4-25 at 19:20 [/i]]

大灰杨 发表于 2005-4-25 19:22

采用的是vbb论坛,发现数据库服务器负载太高,cpu经常到满

crazy 发表于 2005-4-25 20:03

[quote]Originally posted by [i]大灰杨[/i] at 2005-4-25 19:22
采用的是vbb论坛,发现数据库服务器负载太高,cpu经常到满 [/quote]
我用Discuz2.5,Dual Xeon2.4的机器,2G内存,几K在线丝毫不会有任何影响,就算装满插件然后上G级数据库,估计三四K在线还是没问题!

大灰杨 发表于 2005-4-25 20:15

[quote]Originally posted by [i]crazy[/i] at 2005-4-25 20:03

我用Discuz2.5,Dual Xeon2.4的机器,2G内存,几K在线丝毫不会有任何影响,就算装满插件然后上G级数据库,估计三四K在线还是没问题! [/quote]

:o 商业版?

TMD,今天晚上六七百人就掉 :(

[[i] Last edited by 大灰杨 on 2005-4-25 at 20:18 [/i]]

crazy 发表于 2005-4-25 20:24

[quote]Originally posted by [i]大灰杨[/i] at 2005-4-25 20:15


:o 商业版?

TMD,今天晚上六七百人就掉 :( [/quote]
无论商业版或者免费版,在Dual Xeon2.4的机器上,支持2K以上在线不成问题的

crazy 发表于 2005-4-25 20:35

你的机器恐怕是mysql设置问题导致的,以前见过很多人都这样,一有问题就升级硬件,纯浪费!

大灰杨 发表于 2005-4-25 20:52

mysql设置是这样的 /etc/my.cnf

# 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
skip-innodb
max_connections = 800
key_buffer = 64M
myisam_sort_buffer_size = 64M
join_buffer_size = 1M
read_buffer_size = 1M
sort_buffer_size = 2M
table_cache = 2048
thread_cache_size = 128
wait_timeout = 1800
connect_timeout = 10
max_allowed_packet = 64M
max_connect_errors = 800
query_cache_limit = 1M
query_cache_size = 32M
query_cache_type = 1
# Try number of CPU's*2 for thread_concurrency
thread_concurrency = 4

crazy 发表于 2005-4-25 21:04

把这个去掉看看,Linux下默认就是多线程的,不用这样设置!
# Try number of CPU's*2 for thread_concurrency
thread_concurrency = 4

另外可以参考一下我用过的my.cnf,这个是基于Dual Xeon2.4 +2G内存配置的,mysql版本4.0.22,你可以适当修改一下。

[code]# Example MySQL config file for medium systems.
#
# This is for a system with little memory (32M - 64M) where MySQL plays
# an important part, or systems up to 128M where MySQL is used together with
# other programs (such as a web server)
#
# 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/mysql/data) 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]


        set-variable    = key_buffer=512M
        set-variable    = max_allowed_packet=4M
        set-variable    = table_cache=1024
        set-variable    = thread_cache=64
        set-variable    = join_buffer_size=32M
        set-variable    = sort_buffer=32M
        set-variable    = record_buffer=32M
        set-variable    = max_connections=512
        set-variable    = wait_timeout=120
        set-variable    = interactive_timeout=120
        set-variable    = max_connect_errors=30000
        set-variable    = long_query_time=1
        set-variable    = max_heap_table_size=256M
        set-variable    = tmp_table_size=128M
        set-variable    = thread_concurrency=8
        set-variable    = myisam_sort_buffer_size=128M



port                = 3306
socket                = /tmp/mysql.sock
max_connections = 1000
skip-locking
key_buffer = 128M
max_allowed_packet = 4M
table_cache = 1024
sort_buffer_size = 8192K
net_buffer_length = 32K
myisam_sort_buffer_size = 32M

# 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 = 4M
#bdb_max_lock = 10000

# Uncomment the following if you are using InnoDB tables
#innodb_data_home_dir = /usr/local/mysql/data/
#innodb_data_file_path = ibdata1:10M:autoextend
#innodb_log_group_home_dir = /usr/local/mysql/data/
#innodb_log_arch_dir = /usr/local/mysql/data/
# You can set .._buffer_pool_size up to 50 - 80 %
# of RAM but beware of setting memory usage too high
#innodb_buffer_pool_size = 16M
#innodb_additional_mem_pool_size = 2M
# Set .._log_file_size to 25 % of buffer pool size
#innodb_log_file_size = 5M
#innodb_log_buffer_size = 8M
#innodb_flush_log_at_trx_commit = 1
#innodb_lock_wait_timeout = 50

[mysqldump]
quick
max_allowed_packet = 32M

[mysql]
no-auto-rehash
# Remove the next comment character if you are not familiar with SQL
#safe-updates

[isamchk]
key_buffer = 40M
sort_buffer_size = 40M
read_buffer = 4M
write_buffer = 4M

[myisamchk]
key_buffer = 40M
sort_buffer_size = 40M
read_buffer = 4M
write_buffer = 4M

[mysqlhotcopy]
interactive-timeout[/code]

懂技术的痞子 发表于 2005-4-26 08:41

大家都是高手,我就不发表意见了

大灰杨 发表于 2005-4-27 00:54

crazy

你用discez,那么你的httpd.conf是怎么配置的?
maxclients server limit和perchildren数目个是多少?

crazy 发表于 2005-4-27 05:11

[quote]Originally posted by [i]大灰杨[/i] at 2005-4-27 00:54
crazy

你用discez,那么你的httpd.conf是怎么配置的?
maxclients server limit和perchildren数目个是多少? [/quote]
按照你的访问量,这两个值直接使用默认的就非常好的了,而且很稳定。

大灰杨 发表于 2005-4-27 12:41

看来是论坛不同,用vbb的话,mysql并发过了200多就不行了

页: [1] 2

Powered by Discuz! Archiver 6.1.0  © 2001-2007 Comsenz Inc.