Browse Source

Split into two tests: an epoll based and a thread per connection test.

Matthieu Garrigues 10 years ago
parent
commit
70111a2f30

+ 25 - 2
frameworks/C++/silicon/benchmark_config

@@ -2,7 +2,7 @@
   "framework": "silicon",
   "tests": [{
     "default": {
-      "setup_file": "setup",
+      "setup_file": "setup_tpc_mysql",
       "json_url"       : "/json",
       "db_url"         : "/db",
       "query_url"      : "/queries?queries=",
@@ -20,7 +20,30 @@
       "webserver": "None",
       "os": "Linux",
       "database_os": "Linux",
-      "display_name": "silicon",
+      "display_name": "silicon-tpc-mysql",
+      "notes": "",
+      "versus": ""
+    },
+    "silicon-epoll-mysql": {
+      "setup_file": "setup_epoll_mysql",
+      "json_url"       : "/json",
+      "db_url"         : "/db",
+      "query_url"      : "/queries?queries=",
+      "fortune_url"    : "/fortunes",
+      "update_url"     : "/updates?queries=",
+      "plaintext_url"  : "/plaintext",
+      "port": 8080,
+      "approach": "Realistic",
+      "classification": "Micro",
+      "database": "MySQL",
+      "framework": "silicon",
+      "language": "C++",
+      "orm": "Full",
+      "platform": "Silicon",
+      "webserver": "None",
+      "os": "Linux",
+      "database_os": "Linux",
+      "display_name": "silicon-epoll-mysql",
       "notes": "",
       "versus": ""
     }

+ 9 - 15
frameworks/C++/silicon/main.cc

@@ -22,7 +22,6 @@ typedef mysql_orm<random_number> rn_orm;
 typedef mysql_orm_factory<fortune> fortune_orm_factory;
 typedef mysql_orm<fortune> fortune_orm;
 
-
 std::string escape_html_entities(const std::string& data)
 {
     std::string buffer;
@@ -43,9 +42,9 @@ std::string escape_html_entities(const std::string& data)
 int main(int argc, char* argv[])
 {
 
-  if (argc != 4)
+  if (argc != 3)
   {
-    std::cerr << "Usage: " << argv[0] << " mysql_host port pid_file" << std::endl;
+    std::cerr << "Usage: " << argv[0] << " mysql_host port" << std::endl;
     return 1;
   }
   
@@ -110,20 +109,15 @@ int main(int argc, char* argv[])
   
   try
   {
-    // Demonize the process.
-    if (daemon(0,0))
-    {
-      std::cerr << "Cannot start the daemon." << std::endl;
-      exit(1);
-    }
-
-    // Write the pid.
-    std::ofstream pidfile(argv[3]);
-    pidfile << getpid() << std::endl;
-    pidfile.close();
 
     // Start the server.
-    sl::mhd_json_serve(hello_api, atoi(argv[2]));
+    sl::mhd_json_serve(hello_api, atoi(argv[2])
+#ifdef TFB_USE_EPOLL
+                       , _linux_epoll, _nthreads = 1000
+#else
+                       , _one_thread_per_connection
+#endif
+      );
   }
   catch (std::exception& e)
   {

+ 0 - 3
frameworks/C++/silicon/setup.sh

@@ -1,3 +0,0 @@
-#! /bin/bash
-
-$TROOT/build/silicon_app ${DBHOST} 8080 /tmp/silicon_pid_file &

+ 3 - 0
frameworks/C++/silicon/setup_epoll_mysql.sh

@@ -0,0 +1,3 @@
+#! /bin/bash
+
+$TROOT/build/silicon_epoll_mysql ${DBHOST} 8080 &

+ 3 - 0
frameworks/C++/silicon/setup_tpc_mysql.sh

@@ -0,0 +1,3 @@
+#! /bin/bash
+
+$TROOT/build/silicon_tpc_mysql ${DBHOST} 8080 &