code_junkie

DB Connections in ASP.NET, MySQL vs. SQL Server

Nov 13th, 2011
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.15 KB | None | 0 0
  1. // MySQL
  2.  
  3. const string CONNECTION_STRING =
  4. "server=localhost;database=testdb;user id=root;password=mypassword;max pool size=250;";
  5. for (int i = 0; i < 5000; i++)
  6. {
  7. using (MySqlConnection con = new MySqlConnection(CONNECTION_STRING))
  8. {
  9. con.Open();
  10. }
  11. }
  12.  
  13. // SQL Server
  14.  
  15. const string CONNECTION_STRING = "Data Source=localhost;Initial Catalog=testdb;Integrated Security=True;max pool size=250;";
  16. for (int i = 0; i < 5000; i++)
  17. {
  18. using (SqlConnection con = new SqlConnection(CONNECTION_STRING))
  19. {
  20. con.Open();
  21. }
  22. }
  23.  
  24. [client]
  25. port = 3306
  26. socket = /tmp/mysql.sock
  27.  
  28. [mysqld]
  29. port = 3306
  30. socket = /tmp/mysql.sock
  31. skip-locking
  32. key_buffer = 384M
  33. max_allowed_packet = 1M
  34. table_cache = 512
  35. sort_buffer_size = 2M
  36. read_buffer_size = 2M
  37. read_rnd_buffer_size = 8M
  38. myisam_sort_buffer_size = 64M
  39. thread_cache_size = 8
  40. query_cache_size = 32M
  41. thread_concurrency = 8
  42.  
  43. server-id = 1
  44.  
  45. [mysqldump]
  46. quick
  47. max_allowed_packet = 16M
  48.  
  49. [mysql]
  50. no-auto-rehash
  51.  
  52. [isamchk]
  53. key_buffer = 256M
  54. sort_buffer_size = 256M
  55. read_buffer = 2M
  56. write_buffer = 2M
  57.  
  58. [myisamchk]
  59. key_buffer = 256M
  60. sort_buffer_size = 256M
  61. read_buffer = 2M
  62. write_buffer = 2M
  63.  
  64. [mysqlhotcopy]
  65. interactive-timeout
Add Comment
Please, Sign In to add comment