Browse Source

Fixing a lot more production-only bugs

msmith-techempower 10 years ago
parent
commit
acac7e9250

+ 3 - 3
frameworks/Java/jawn/benchmark_config.json

@@ -9,7 +9,7 @@
       "fortune_url": "/fortunes",
       "update_url": "/updates?queries=",
       "plaintext_url": "/plaintext",
-      "port": 8081,
+      "port": 8080,
       "approach": "Realistic",
       "classification": "Fullstack",
       "database": "MySQL",
@@ -17,12 +17,12 @@
       "language": "Java",
       "orm": "Raw",
       "platform": "Servlet",
-      "webserver": "Jetty",
+      "webserver": "Undertow",
       "os": "Linux",
       "database_os": "Linux",
       "display_name": "jawn",
       "notes": "",
-      "versus": "servlet"
+      "versus": ""
     }
   }]
 }

+ 2 - 2
frameworks/Java/jawn/build.gradle

@@ -19,12 +19,12 @@ repositories {
 
 dependencies {
 	// Framework
-	compile 'net.javapla.jawn:jawn-server-undertow:0.8.7'
+	compile 'net.javapla.jawn:jawn-server-undertow:0.8.9-b01'
 	//compile project(':jawn-server'), project(':jawn-server-undertow'), project(':jawn-server-jetty')
 
 	
 	// Database
-	compile 'mysql:mysql-connector-java:5.1.35'
+	compile 'mysql:mysql-connector-java:5.1.36'
 	
 	//Logging 
 	runtime group: 'ch.qos.logback', name: 'logback-classic', version: '1.1.3' exclude group: 'org.slf4j'

+ 1 - 1
frameworks/Java/jawn/setup.sh

@@ -6,4 +6,4 @@ sed -i 's|127.0.0.1|'${DBHOST}'|g' src/main/java/app/config/Database.java
 
 ./gradlew clean --daemon
 
-./gradlew run -Pargs=production &
+./gradlew run -Pargs=production

+ 4 - 1
frameworks/Java/jawn/src/main/java/app/UndertowMain.java

@@ -2,6 +2,7 @@ package app;
 
 import net.javapla.jawn.server.UndertowServer;
 import net.javapla.jawn.server.spi.ServerConfig;
+import net.javapla.jawn.server.spi.ServerConfig.PERFORMANCE_MODE;
 
 public class UndertowMain {
 
@@ -16,8 +17,10 @@ public class UndertowMain {
         
         ServerConfig config = new ServerConfig();
         config.setContextPath("/");
-        config.setPort(8081);
+        config.setPort(8080);
         config.setWebappPath("webapp");
+        config.setServerPerformance(PERFORMANCE_MODE.HIGHEST);
+        config.setHost("0.0.0.0");
         
         UndertowServer server = new UndertowServer();
         server.setupAndStartServer(config);

+ 0 - 1
frameworks/Java/jawn/src/main/java/app/config/Database.java

@@ -27,7 +27,6 @@ public class Database implements ApplicationDatabaseBootstrap {
         
         String dbUrl = "jdbc:mysql://127.0.0.1:3306/hello_world?";
         
-        
         connections
             .environment(Modes.prod)
             .jdbc()

+ 1 - 1
frameworks/Java/jawn/src/main/java/app/db/DbManager.java

@@ -27,7 +27,7 @@ public class DbManager {
     public DbManager(DatabaseConnection spec) throws ClassNotFoundException, SQLException, PropertyVetoException {
         if (spec == null) throw new InitException("DatabaseConnection is null");
         
-        source = spec.createDataSource();
+        source = spec;
     }
     
     public World getWorld(int id) {

+ 1 - 2
frameworks/Java/undertow-edge/setup.sh

@@ -1,7 +1,6 @@
 #!/bin/bash
 
-sed -i 's|mysql://.*:3306|mysql://'"${DBHOST}"':3306|g' src/main/resources/hello/server.properties
-sed -i 's|postgresql://.*:5432|postgresql://'"${DBHOST}"':5432|g' src/main/resources/hello/server.properties
+sed -i 's|127.0.0.1|'${DBHOST}'|g' src/main/resources/hello/server.properties
 
 fw_depends java7 maven
 

+ 3 - 3
frameworks/Java/undertow-edge/src/main/resources/hello/server.properties

@@ -1,14 +1,14 @@
 web.port = 8080
 web.host = 0.0.0.0
-mysql.uri = jdbc:mysql://localhost:3306/hello_world?jdbcCompliantTruncation=false&elideSetAutoCommits=true&useLocalSessionState=true&cachePrepStmts=true&cacheCallableStmts=true&alwaysSendSetIsolation=false&prepStmtCacheSize=4096&cacheServerConfiguration=true&prepStmtCacheSqlLimit=2048&zeroDateTimeBehavior=convertToNull&traceProtocol=false&useUnbufferedInput=false&useReadAheadInput=false&maintainTimeStats=false&useServerPrepStmts&cacheRSMetadata=true
+mysql.uri = jdbc:mysql://127.0.0.1:3306/hello_world?jdbcCompliantTruncation=false&elideSetAutoCommits=true&useLocalSessionState=true&cachePrepStmts=true&cacheCallableStmts=true&alwaysSendSetIsolation=false&prepStmtCacheSize=4096&cacheServerConfiguration=true&prepStmtCacheSqlLimit=2048&zeroDateTimeBehavior=convertToNull&traceProtocol=false&useUnbufferedInput=false&useReadAheadInput=false&maintainTimeStats=false&useServerPrepStmts&cacheRSMetadata=true
 mysql.user = benchmarkdbuser
 mysql.password = benchmarkdbpass
 #
 # TODO: Audit this postgresql connection string.
 # It looks copy & pasted from MySQL.  Do these parameters even do anything?
 #
-postgresql.uri = jdbc:postgresql://localhost:5432/hello_world?jdbcCompliantTruncation=false&elideSetAutoCommits=true&useLocalSessionState=true&cachePrepStmts=true&cacheCallableStmts=true&alwaysSendSetIsolation=false&prepStmtCacheSize=4096&cacheServerConfiguration=true&prepStmtCacheSqlLimit=2048&zeroDateTimeBehavior=convertToNull&traceProtocol=false&useUnbufferedInput=false&useReadAheadInput=false&maintainTimeStats=false&useServerPrepStmts&cacheRSMetadata=true
+postgresql.uri = jdbc:postgresql://127.0.0.1:5432/hello_world?jdbcCompliantTruncation=false&elideSetAutoCommits=true&useLocalSessionState=true&cachePrepStmts=true&cacheCallableStmts=true&alwaysSendSetIsolation=false&prepStmtCacheSize=4096&cacheServerConfiguration=true&prepStmtCacheSqlLimit=2048&zeroDateTimeBehavior=convertToNull&traceProtocol=false&useUnbufferedInput=false&useReadAheadInput=false&maintainTimeStats=false&useServerPrepStmts&cacheRSMetadata=true
 postgresql.user = benchmarkdbuser
 postgresql.password = benchmarkdbpass
-mongodb.host = localhost:27017
+mongodb.host = 127.0.0.1:27017
 mongodb.name = hello_world

+ 2 - 2
frameworks/Java/wicket/setup.sh

@@ -1,9 +1,9 @@
 #!/bin/bash
 
-sed -i 's|mysql://.*:3306|mysql://'"${DBHOST}"':3306|g' src/main/webapp/WEB-INF/resin-web.xml
-
 fw_depends java7 resin maven
 
+sed -i 's|127.0.0.1|'${DBHOST}'|g' src/main/webapp/WEB-INF/resin-web.xml
+
 mvn clean compile war:war
 rm -rf $RESIN_HOME/webapps/*
 cp target/hellowicket-1.0-SNAPSHOT.war $RESIN_HOME/webapps/wicket.war

+ 1 - 1
frameworks/Java/wicket/src/main/webapp/WEB-INF/resin-web.xml

@@ -4,7 +4,7 @@
   <driver>
     <type>com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource</type>
    
-		<url>jdbc:mysql://localhost:3306/hello_world?jdbcCompliantTruncation=false&amp;elideSetAutoCommits=true&amp;useLocalSessionState=true&amp;cachePrepStmts=true&amp;cacheCallableStmts=true&amp;alwaysSendSetIsolation=false&amp;prepStmtCacheSize=4096&amp;cacheServerConfiguration=true&amp;prepStmtCacheSqlLimit=2048&amp;zeroDateTimeBehavior=convertToNull&amp;traceProtocol=false&amp;useUnbufferedInput=false&amp;useReadAheadInput=false&amp;maintainTimeStats=false&amp;useServerPrepStmts&amp;cacheRSMetadata=true</url>
+		<url>jdbc:mysql://127.0.0.1:3306/hello_world?jdbcCompliantTruncation=false&amp;elideSetAutoCommits=true&amp;useLocalSessionState=true&amp;cachePrepStmts=true&amp;cacheCallableStmts=true&amp;alwaysSendSetIsolation=false&amp;prepStmtCacheSize=4096&amp;cacheServerConfiguration=true&amp;prepStmtCacheSqlLimit=2048&amp;zeroDateTimeBehavior=convertToNull&amp;traceProtocol=false&amp;useUnbufferedInput=false&amp;useReadAheadInput=false&amp;maintainTimeStats=false&amp;useServerPrepStmts&amp;cacheRSMetadata=true</url>
     <user>benchmarkdbuser</user>
     <password>benchmarkdbpass</password>
     <useUnicode/>

+ 1 - 1
frameworks/Python/web2py/app/app/models/db.py

@@ -15,7 +15,7 @@ from gluon.contrib.appconfig import AppConfig
 myconf = AppConfig(reload=True)
 
 DATABASE = None
-DATABASE_URI = "mysql://benchmarkdbuser:benchmarkdbpass@localhost:3306/hello_world"
+DATABASE_URI = "mysql://benchmarkdbuser:benchmarkdbpass@127.0.0.1:3306/hello_world"
 
 db = DAL(DATABASE_URI, fake_migrate_all=True)
 DATABASE = db

+ 3 - 1
frameworks/Python/web2py/setup.sh

@@ -2,6 +2,8 @@
 
 fw_depends python2
 
+sed -i 's|127.0.0.1|'${DBHOST}'|g' app/app/models/db.py
+
 pip install --install-option="--prefix=${PY2_ROOT}" -r $TROOT/requirements.txt
 
 rm -fr web2py
@@ -9,4 +11,4 @@ git clone --recursive --branch R-2.10.3 https://github.com/web2py/web2py.git
 cp -r app/app/ web2py/applications/
 cp app/routes.py web2py/
 
-python web2py/web2py.py -a '' -i 127.0.0.1 -p 8080  &
+python web2py/web2py.py -a '' -i 0.0.0.0 -p 8080  &

+ 1 - 1
frameworks/Ruby/rack/config/database.yml

@@ -1,6 +1,6 @@
 ---
   :encoding: utf8
-  :host: localhost
+  :host: 127.0.0.1
   :database: hello_world
   :username: benchmarkdbuser
   :password: benchmarkdbpass

+ 1 - 1
frameworks/Ruby/rack/run_jruby_puma.sh

@@ -2,7 +2,7 @@
 
 fw_depends rvm java7 jruby-1.7.8
 
-sed -i 's|  host:.*|  host:'"${DBHOST}"'|g' config/database.yml
+sed -i 's|127.0.0.1|'${DBHOST}'|g' config/database.yml
 
 rvm jruby-1.7.8 do bundle install --gemfile=$TROOT/Gemfile
 

+ 1 - 1
frameworks/Ruby/rack/run_mri_puma.sh

@@ -2,7 +2,7 @@
 
 fw_depends rvm ruby-2.0.0
 
-sed -i 's|  host:.*|  host:'"${DBHOST}"'|g' config/database.yml
+sed -i 's|127.0.0.1|'${DBHOST}'|g' config/database.yml
 
 rvm ruby-2.0.0-p0 do bundle install --gemfile=$TROOT/Gemfile --path vendor/bundle
 

+ 1 - 1
frameworks/Ruby/rack/run_rbx_puma.sh

@@ -2,7 +2,7 @@
 
 fw_depends rvm rbx-2.2.10
 
-sed -i 's|  host:.*|  host:'"${DBHOST}"'|g' config/database.yml
+sed -i 's|127.0.0.1|'${DBHOST}'|g' config/database.yml
 
 rvm rbx-2.2.10 do bundle install --gemfile=$TROOT/Gemfile
 

+ 1 - 1
frameworks/Ruby/rack/run_thin.sh

@@ -2,7 +2,7 @@
 
 fw_depends rvm ruby-2.0.0
 
-sed -i 's|  host:.*|  host:'"${DBHOST}"'|g' config/database.yml
+sed -i 's|127.0.0.1|'${DBHOST}'|g' config/database.yml
 
 rvm ruby-2.0.0-p0 do bundle install --gemfile=$TROOT/Gemfile --path vendor/bundle
 

+ 1 - 1
frameworks/Ruby/rack/run_torqbox.sh

@@ -2,7 +2,7 @@
 
 fw_depends rvm java7 jruby-1.7.8
 
-sed -i 's|  host:.*|  host:'"${DBHOST}"'|g' config/database.yml
+sed -i 's|127.0.0.1|'${DBHOST}'|g' config/database.yml
 
 rvm jruby-1.7.8 do bundle install --gemfile=$TROOT/Gemfile
 

+ 1 - 1
frameworks/Ruby/rack/run_trinidad.sh

@@ -2,7 +2,7 @@
 
 fw_depends rvm java7 jruby-1.7.8
 
-sed -i 's|  host:.*|  host:'"${DBHOST}"'|g' config/database.yml
+sed -i 's|127.0.0.1|'${DBHOST}'|g' config/database.yml
 
 rvm jruby-1.7.8 do bundle install --gemfile=$TROOT/Gemfile
 

+ 1 - 1
frameworks/Ruby/rack/run_unicorn.sh

@@ -2,7 +2,7 @@
 
 fw_depends rvm nginx ruby-2.0.0
 
-sed -i 's|  host:.*|  host:'"${DBHOST}"'|g' config/database.yml
+sed -i 's|127.0.0.1|'${DBHOST}'|g' config/database.yml
 sed -i 's|/usr/local/nginx/|'"${IROOT}"'/nginx/|g' config/nginx.conf
 
 rvm ruby-2.0.0-p0 do bundle install --gemfile=$TROOT/Gemfile --path vendor/bundle

+ 1 - 1
frameworks/Rust/iron/src/main.rs

@@ -17,7 +17,7 @@ fn main() {
     router.get("/json", jsonHandler);
     router.get("/plaintext", plaintextHandler);
 
-    Iron::new(router).http("127.0.0.1:8080").unwrap();
+    Iron::new(router).http("0.0.0.0:8080").unwrap();
 }
 
 fn jsonHandler(req: &mut Request) -> IronResult<Response> {

+ 1 - 1
frameworks/Rust/nickel/src/main.rs

@@ -27,5 +27,5 @@ fn main() {
     });
 
     server.utilize(router);
-    server.listen("127.0.0.1:8080");
+    server.listen("0.0.0.0:8080");
 }

+ 1 - 1
frameworks/Scala/scruffy/setup.sh

@@ -2,7 +2,7 @@
 
 fw_depends java7 sbt
 
-sed -i 's|database_host|'"${DBHOST}"'|g' src/main/scala/scruffy/examples/Test2Endpoint.scala
+sed -i 's|127.0.0.1|'${DBHOST}'|g' src/main/scala/scruffy/examples/Test2Endpoint.scala
 
 sbt assembly
 

+ 1 - 1
frameworks/Scala/scruffy/src/main/scala/scruffy/examples/Test2Endpoint.scala

@@ -10,7 +10,7 @@ object Test2Endpoint extends HttpModule {
 
   import com.sksamuel.scruffy.jackson.ScruffyJackson.Implicits._
 
-  val hostname = "localhost"
+  val hostname = "127.0.0.1"
   val connection = MongoConnection(hostname, 27017)
   val collection = connection.getDB("hello_world").getCollection("world")