Sha256: 52b60668c95e04736ecdf7231da9bfec151a632e4c510d8790e9f19e130bf941

Contents?: true

Size: 1.04 KB

Versions: 30

Compression:

Stored size: 1.04 KB

Contents

//#define USE_SERVER

#include <iostream>
#include <boost/bind.hpp>
#include <boost/thread.hpp>
#ifdef USE_SERVER
	#include "ApplicationPoolServer.h"
#else
	#include "StandardApplicationPool.h"
#endif
#include "Utils.h"
#include "Logging.h"

using namespace std;
using namespace boost;
using namespace Passenger;

#define TRANSACTIONS 20000
#define CONCURRENCY 24

ApplicationPoolPtr pool;

static void
threadMain(unsigned int times) {
	for (unsigned int i = 0; i < times; i++) {
		Application::SessionPtr session(pool->get("test/stub/minimal-railsapp"));
		for (int x = 0; x < 200000; x++) {
			// Do nothing.
		}
	}
}

int
main() {
	thread_group tg;
	#ifdef USE_SERVER
		ApplicationPoolServer server("ext/apache2/ApplicationPoolServerExecutable",
			"bin/passenger-spawn-server");
		pool = server.connect();
	#else
		pool = ptr(new StandardApplicationPool("bin/passenger-spawn-server"));
	#endif
	pool->setMax(6);
	
	for (int i = 0; i < CONCURRENCY; i++) {
		tg.create_thread(boost::bind(&threadMain, TRANSACTIONS / CONCURRENCY));
	}
	
	tg.join_all();
	return 0;
}

Version data entries

30 entries across 30 versions & 5 rubygems

Version Path
rockdog-passenger-0.0.1 benchmark/ApplicationPool.cpp
vanity-1.7.1 vendor/ruby/1.9.1/gems/passenger-2.2.15/benchmark/ApplicationPool.cpp
passenger-2.2.15 benchmark/ApplicationPool.cpp
passenger-2.2.14 benchmark/ApplicationPool.cpp
passenger-2.2.13 benchmark/ApplicationPool.cpp
passenger-2.2.12 benchmark/ApplicationPool.cpp
colouringcode-passenger-0.2 benchmark/ApplicationPool.cpp
passenger-2.2.11 benchmark/ApplicationPool.cpp
passenger-jmazzi-2.2.10 benchmark/ApplicationPool.cpp
passenger-2.2.10 benchmark/ApplicationPool.cpp
passenger-jmazzi-2.2.9 benchmark/ApplicationPool.cpp
passenger-2.2.9 benchmark/ApplicationPool.cpp
passenger-2.2.8 benchmark/ApplicationPool.cpp
colouringcode-passenger-0.1 benchmark/ApplicationPool.cpp
passenger-2.2.7 benchmark/ApplicationPool.cpp
passenger-2.2.6 benchmark/ApplicationPool.cpp
passenger-2.2.5 benchmark/ApplicationPool.cpp
passenger-2.2.3 benchmark/ApplicationPool.cpp
passenger-2.2.4 benchmark/ApplicationPool.cpp
passenger-2.0.1 benchmark/ApplicationPool.cpp