Browse Source

Merge pull request #793 from oberhamsi/ringo-config-improve

bump ringo version to 0.10
jlucier-techempower 11 years ago
parent
commit
6c8c73264d

+ 2 - 1
ringojs-convenient/app/models.js

@@ -6,8 +6,9 @@ var dbHost = '172.16.98.98';
 
 // create and configure store
 var connectionPool = module.singleton("connectionPool", function() {
+    var mysqlConnectionProperties = "?jdbcCompliantTruncation=false&elideSetAutoCommits=true&useLocalSessionState=true&cachePrepStmts=true&cacheCallableStmts=true&alwaysSendSetIsolation=false&prepStmtCacheSize=4096&cacheServerConfiguration=true&prepStmtCacheSqlLimit=2048&zeroDateTimeBehavior=convertToNull&traceProtocol=false&useServerPrepStmts&enableQueryTimeouts=false&useUnbufferedIO=false&useReadAheadInput=false&maintainTimeStats=false&cacheRSMetadata=true";
     return new ConnectionPool({
-        "url": "jdbc:mysql://" + dbHost + "/hello_world",
+        "url": "jdbc:mysql://" + dbHost + "/hello_world" + mysqlConnectionProperties,
         "driver": "com.mysql.jdbc.Driver",
         "username": "benchmarkdbuser",
         "password": "benchmarkdbpass"

+ 1 - 8
ringojs-convenient/app/views.js

@@ -23,7 +23,6 @@ app.get('/db/:queries?', function(request, queries) {
    for (var i = 0; i < queries; i++) {
       randId = ((Math.random() * 10000) | 0) + 1;
       world = models.store.query('select World.* from World where World.id = :id', {id: randId})[0];
-      //worlds.push(world.toJSON());
       worlds.push({"id": world._id, "randomNumber" : world.randomNumber});
    }
    if (queries == 1) {
@@ -43,13 +42,7 @@ app.get('/fortune', function() {
 });
 
 app.get('/plaintext', function() {
-   // @@ not available in ringojs 0.9
-   // return response.text('Hello World');
-   return {
-     status: 200,
-     headers: {"Content-Type": 'text/plain'},
-     body: ['Hello, World!']
-   };
+   return response.text('Hello, World!');
 });
 
 app.get('/updates/:queries?', function(request, queries) {

+ 1 - 1
ringojs-convenient/setup.py

@@ -17,7 +17,7 @@ def start(args, logfile, errfile):
 
     subprocess.check_call("sudo mkdir -p /usr/share/ringojs/packages/ringo-sqlstore/jars/", shell=True, stderr=errfile, stdout=logfile)
     subprocess.check_call("sudo cp /usr/share/ringojs//packages/sql-ringojs-client/jars/mysql.jar /usr/share/ringojs/packages/ringo-sqlstore/jars/", shell=True, stderr=errfile, stdout=logfile)
-    subprocess.Popen("ringo --production -Dserver -DXmx=512m -DXms=512m ringo-main.js", shell=True, cwd="ringojs-convenient", stderr=errfile, stdout=logfile)
+    subprocess.Popen("ringo --production -J-server -J-Xmx1g -J-Xms1g ringo-main.js", shell=True, cwd="ringojs-convenient", stderr=errfile, stdout=logfile)
     return 0
   except subprocess.CalledProcessError:
     return 1

+ 2 - 1
ringojs/ringo-main.js

@@ -120,7 +120,8 @@ exports.app = function(req) {
 
 
 var datasource = module.singleton('pooling-datasource', function() {
-  return sql.connect("jdbc:mysql://" + dbHost + "/hello_world", 'benchmarkdbuser', 'benchmarkdbpass');
+  var mysqlConnectionProperties = "?jdbcCompliantTruncation=false&elideSetAutoCommits=true&useLocalSessionState=true&cachePrepStmts=true&cacheCallableStmts=true&alwaysSendSetIsolation=false&prepStmtCacheSize=4096&cacheServerConfiguration=true&prepStmtCacheSqlLimit=2048&zeroDateTimeBehavior=convertToNull&traceProtocol=false&useServerPrepStmts&enableQueryTimeouts=false&useUnbufferedIO=false&useReadAheadInput=false&maintainTimeStats=false&cacheRSMetadata=true";
+  return sql.connect("jdbc:mysql://" + dbHost + "/hello_world" + mysqlConnectionProperties, 'benchmarkdbuser', 'benchmarkdbpass');
 });
 
 if (require.main == module) {

+ 1 - 1
ringojs/setup.py

@@ -10,7 +10,7 @@ def start(args, logfile, errfile):
   try:
     subprocess.check_call("sudo rm -rf /usr/share/ringojs/packages/*", shell=True, stderr=errfile, stdout=logfile)
     subprocess.check_call("sudo ringo-admin install oberhamsi/sql-ringojs-client", shell=True, stderr=errfile, stdout=logfile)
-    subprocess.Popen("ringo --production -Dserver -DXmx=512m -DXms=512m ringo-main.js", shell=True, cwd="ringojs", stderr=errfile, stdout=logfile)
+    subprocess.Popen("ringo --production -J-server -J-Xmx1g -J-Xms1g ringo-main.js", shell=True, cwd="ringojs", stderr=errfile, stdout=logfile)
     return 0
   except subprocess.CalledProcessError:
     return 1

+ 3 - 3
toolset/setup/linux/installer.py

@@ -159,10 +159,10 @@ class Installer:
     #
     # RingoJs
     #
-    self.__download("http://www.ringojs.org/downloads/ringojs_0.9-1_all.deb")
+    self.__download("http://www.ringojs.org/downloads/ringojs_0.10-1_all.deb")
     self.__run_command("sudo apt-get install jsvc", True)
-    self.__run_command("sudo dpkg -i ringojs_0.9-1_all.deb", True)
-    self.__run_command("rm ringojs_0.9-1_all.deb")
+    self.__run_command("sudo dpkg -i ringojs_0.10-1_all.deb", True)
+    self.__run_command("rm ringojs_0.10-1_all.deb")
 
     #
     # Mono