用mysql5.5.15 ,基于myisam引擎的一个表当作两个进程之间的数据交换队列,也就是A进程不断在追加数据,B进程在不断取第一条数据,用完后删除第一条数据。
在my.cnf里已经配置了myisam并发操作有关的参数,但是存进去的数据和取出来的数据数量上不一致,存进去的多,取出来的少,中间随机掉了一些数据,但是存取过程中并没有报错。显式加锁也用过了不起作用。另外需要说明的是我的这个表里就只有两个blob字段。
我只想实现myisam引擎存进去的数据和取出来的数据数量内容一致,效率可以低一些。
请问各位高手,能给出一些建议吗?以下是我的my.cnf# The MySQL server
[mysqld]
basedir = /usr/local/mysql
datadir = /usr/local/mysql/var/data
port = 3306
socket = /usr/local/mysql/var/mysql.sockskip-external-locking
key_buffer_size = 256M
max_allowed_packet = 32M
concurrent_insert = 2
max_write_lock_count=1
low-priority-updates = 1
table_open_cache = 256
sort_buffer_size = 1M
read_buffer_size = 1M
read_rnd_buffer_size = 4M
myisam_sort_buffer_size = 64M
thread_cache_size = 8
query_cache_size= 16M
wait_timeout=28800
interactive_timeout=28800
# Try number of CPU's*2 for thread_concurrency
thread_concurrency = 2log-bin=mysql-binbinlog_format=mixed
server-id = 1[mysqldump]
quick
max_allowed_packet = 16M[mysql]
no-auto-rehash
# Remove the next comment character if you are not familiar with SQL
#safe-updates[myisamchk]
key_buffer_size = 128M
sort_buffer_size = 128M
read_buffer = 2M
write_buffer = 2M[mysqlhotcopy]
interactive-timeout
在my.cnf里已经配置了myisam并发操作有关的参数,但是存进去的数据和取出来的数据数量上不一致,存进去的多,取出来的少,中间随机掉了一些数据,但是存取过程中并没有报错。显式加锁也用过了不起作用。另外需要说明的是我的这个表里就只有两个blob字段。
我只想实现myisam引擎存进去的数据和取出来的数据数量内容一致,效率可以低一些。
请问各位高手,能给出一些建议吗?以下是我的my.cnf# The MySQL server
[mysqld]
basedir = /usr/local/mysql
datadir = /usr/local/mysql/var/data
port = 3306
socket = /usr/local/mysql/var/mysql.sockskip-external-locking
key_buffer_size = 256M
max_allowed_packet = 32M
concurrent_insert = 2
max_write_lock_count=1
low-priority-updates = 1
table_open_cache = 256
sort_buffer_size = 1M
read_buffer_size = 1M
read_rnd_buffer_size = 4M
myisam_sort_buffer_size = 64M
thread_cache_size = 8
query_cache_size= 16M
wait_timeout=28800
interactive_timeout=28800
# Try number of CPU's*2 for thread_concurrency
thread_concurrency = 2log-bin=mysql-binbinlog_format=mixed
server-id = 1[mysqldump]
quick
max_allowed_packet = 16M[mysql]
no-auto-rehash
# Remove the next comment character if you are not familiar with SQL
#safe-updates[myisamchk]
key_buffer_size = 128M
sort_buffer_size = 128M
read_buffer = 2M
write_buffer = 2M[mysqlhotcopy]
interactive-timeout
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货