亚洲av成人无遮挡网站在线观看,少妇性bbb搡bbb爽爽爽,亚洲av日韩精品久久久久久,兔费看少妇性l交大片免费,无码少妇一区二区三区

  免費注冊 查看新帖 |

Chinaunix

  平臺 論壇 博客 文庫
1234下一頁
最近訪問板塊 發(fā)新帖
查看: 10584 | 回復: 34
打印 上一主題 下一主題

[OpenBSD] OpenBSD的mysql是否被限制了什么???? [復制鏈接]

論壇徽章:
0
跳轉(zhuǎn)到指定樓層
1 [收藏(0)] [報告]
發(fā)表于 2008-12-03 15:31 |只看該作者 |倒序瀏覽
OpenBSD4.2 + mysql-server-5.0.45
OpenBSD4.4 + mysql-server-5.0.51a
pkg_add 直接安裝的 mysql-server-5.0.45 mysql-server-5.0.51a

在以下程序測試中,跑出來的效果很出人意料,在實際應用上,以每一秒鐘為單位,鏈接數(shù)據(jù)庫,也有不少這樣的錯誤:

  1. [Wed Dec  3 14:52:46 2008] [error] PHP Warning:  mysql_connect() [<a href='funct
  2. ion.mysql-connect'>function.mysql-connect</a>]: Can't connect to MySQL server on
  3. '127.0.0.1' (61) in /vhost/www.abc.com/init.php on line 23

復制代碼

程序1:

  1. <?php
  2. /*
  3. // [url]http://bugs.mysql.com/bug.php?id=23443[/url]
  4. // [url]http://bugs.mysql.com/file.php?id=4673&text=1[/url]
  5. $link=mysqli_connect("127.0.0.1","root","") or die("can't connect");
  6. mysqli_select_db($link,"test") or die(mysqli_error($link));
  7. mysqli_query($link,"drop table if exists oom") or die(mysqli_error($link));
  8. mysqli_query($link,"create table oom(id int)") or die(mysqli_error($link));
  9. mysqli_query($link,"insert into oom(id) values (1),(2),(3),(4),(5)") or die(mysqli_error($link));
  10. for($i=0;$i<100000;$i++)
  11. {
  12.    mysqli_query($link,"set @var".$i."=repeat('a',100000)") or print('1 - ' . mysqli_error($link) . "\n");
  13.    mysqli_query($link,"select * from oom group by id") or print('2 - ' . mysqli_error($link) . "\n");
  14. }
  15. mysqli_close($link);
  16. */

  17. $link = mysql_connect('127.0.0.1', 'root', '') or die('111');
  18. mysql_select_db('test', $link) or die(mysql_error($link));

  19. mysql_query("drop table if exists oom", $link) or die(mysql_error($link));
  20. mysql_query("create table oom(id int)", $link) or die(mysql_error($link));
  21. mysql_query("insert into oom(id) values (1),(2),(3),(4),(5)", $link) or die(mysql_error($link));

  22. for ($i = 0; $i < 100000; $i++) {
  23.    echo $i." => ";
  24.    mysql_query("set @var".$i."=repeat('a',100000)", $link) or print('1 - ' . mysql_error($link) . "\n");
  25.    mysql_query("select * from oom group by id", $link) or print('2 - ' . mysql_error($link) . "\n");
  26. }

  27. mysql_close($link);
  28. ?>

  29. 出錯信息:
  30. 43 => 10044 => 10045 => 10046 => 10047 => 10048 => 10049 => 10050 => 10051 => 10052 => 10053 => 10054 => 10055 => 2 - Out of memory (Needed 256008 bytes)
  31. 10056 => 2 - Out of memory (Needed 256008 bytes)
  32. 10057 => 2 - Out of memory (Needed 256008 bytes)

復制代碼



程序2:



  1. <?php
  2. for ($i = 0; $i < 100000; $i++) {
  3.         $link = mysql_connect('127.0.0.1', 'root', '', true);
  4.         echo "$i => ";
  5.         var_dump($link);

  6. }

  7. ?>

  8. 出錯信息:
  9. 3127 => resource(3059) of type (mysql link)
  10. 3128 => resource(3060) of type (mysql link)
  11. 3129 => resource(3061) of type (mysql link)
  12. 3130 => resource(3062) of type (mysql link)
  13. 3131 => resource(3063) of type (mysql link)
  14. 3132 => resource(3064) of type (mysql link)
  15. 3133 => resource(3065) of type (mysql link)
  16. PHP Warning:  mysql_connect(): Can't connect to MySQL server on '127.0.0.1' (65) in /home/test.php on line 4

復制代碼


程序3:

  1. use DBI;
  2. $dsn = "DBI:mysql:database=test;host=127.0.0.1;port=3306";
  3. for ($i = 0; $i < 5000; $i++) {
  4.         $dbh = DBI->connect($dsn, 'root', '');
  5.         if (!$dbh) { exit 1; }
  6.         print $i, ' ', $dbh, "\n";
  7. }

  8. 出錯信息:
  9. 25 DBI::db=HASH(0x877f9240)
  10. 226 DBI::db=HASH(0x877f9a8c)
  11. 227 DBI::db=HASH(0x877f993c)
  12. 228 DBI::db=HASH(0x877f9e88)
  13. 229 DBI::db=HASH(0x877f927c)
  14. 230 DBI::db=HASH(0x877f94b0)
  15. 231 DBI::db=HASH(0x877f9084)
  16. 232 DBI::db=HASH(0x877f9bb8)
  17. 233 DBI::db=HASH(0x877f9b34)
  18. 234 DBI::db=HASH(0x877f9dc8)
  19. 235 DBI::db=HASH(0x863f915c)
  20. DBI connect('database=test;host=127.0.0.1;port=3306','root',...) failed: Can't connect to MySQL server on '127.0.0.1' (65) at 2.pl line 4


復制代碼


以上幾個程序在同樣的硬件配置中,freebsd ,linux 跑出來的結(jié)果是以上結(jié)果的十倍以上
是不是OpenBSD系統(tǒng)里面限制了什么????

http://www.openbsdonly.org/viewtopic.php?f=17&t=640



大家有沒有新的提意,提示什么的???

[ 本帖最后由 cnduly 于 2008-12-3 18:26 編輯 ]

論壇徽章:
0
2 [報告]
發(fā)表于 2008-12-03 15:46 |只看該作者
配置MYSQL打開文件數(shù)量:

# vi /etc/my.cnf

open-files = 10000
max_connections = 1024

論壇徽章:
0
3 [報告]
發(fā)表于 2008-12-03 15:55 |只看該作者
原帖由 llzqq 于 2008-12-3 15:46 發(fā)表
配置MYSQL打開文件數(shù)量:

# vi /etc/my.cnf

open-files = 10000
max_connections = 1024




謝謝回復,這個早試過了!! 還是一樣的!!

論壇徽章:
0
4 [報告]
發(fā)表于 2008-12-03 16:13 |只看該作者
修改mysql的登陸類

  1. vi /etc/login.conf
  2. 加入

  3. mysql:\
  4.                 :openfiles-cur=1024:\
  5.                 :openfiles-max=2048:\
  6.                 :tc=daemon:
  7. 保存退出後運行

  8. cap_mkdb /etc/login.conf
  9. usermod -L mysql _mysql
復制代碼

[ 本帖最后由 wosl2001 于 2008-12-3 16:14 編輯 ]

論壇徽章:
0
5 [報告]
發(fā)表于 2008-12-03 18:25 |只看該作者
原帖由 wosl2001 于 2008-12-3 16:13 發(fā)表
修改mysql的登陸類

vi /etc/login.conf
加入

mysql:\
                penfiles-cur=1024:\
                penfiles-max=2048:\
                :tc=daemon:
保存退出後運行

cap_mkdb / ...




都試過了!! 結(jié)果還是差不多

論壇徽章:
0
6 [報告]
發(fā)表于 2008-12-04 13:56 |只看該作者
改內(nèi)核變量了嗎?
kern.maxfiles=4096 (or more)

option BUFCACHEPERCENT=45

from--  http://www.openbsdsupport.org/mysql.htm
mysqlcheck -m -A -uYourUsers -pYourPassword

論壇徽章:
0
7 [報告]
發(fā)表于 2008-12-04 15:01 |只看該作者
原帖由 westfox 于 2008-12-4 13:56 發(fā)表
改內(nèi)核變量了嗎?
kern.maxfiles=4096 (or more)

option BUFCACHEPERCENT=45

from--  http://www.openbsdsupport.org/mysql.htm
mysqlcheck -m -A -uYourUsers -pYourPassword




謝謝 回復,早修改成極端的啦!!
kern.maxfiles=65535

論壇徽章:
0
8 [報告]
發(fā)表于 2008-12-04 15:16 |只看該作者
好點沒有?

論壇徽章:
0
9 [報告]
發(fā)表于 2008-12-04 17:22 |只看該作者
mysql是thread的重度使用程序,但OB的thread是完全用戶級實現(xiàn).rthread還不穩(wěn)定,不過你可以一試,

需要重編譯kernel. "option RTHREADS".

some google result
- http://kerneltrap.org/node/5186
- http://unix.derkeiler.com/Newsgr ... 06-04/msg00075.html

論壇徽章:
0
10 [報告]
發(fā)表于 2008-12-06 14:57 |只看該作者
頂,還沒有解決!!!
您需要登錄后才可以回帖 登錄 | 注冊

本版積分規(guī)則 發(fā)表回復

  

北京盛拓優(yōu)訊信息技術(shù)有限公司. 版權(quán)所有 京ICP備16024965號-6 北京市公安局海淀分局網(wǎng)監(jiān)中心備案編號:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年舉報專區(qū)
中國互聯(lián)網(wǎng)協(xié)會會員  聯(lián)系我們:huangweiwei@itpub.net
感謝所有關(guān)心和支持過ChinaUnix的朋友們 轉(zhuǎn)載本站內(nèi)容請注明原作者名及出處

清除 Cookies - ChinaUnix - Archiver - WAP - TOP