• Stars
    star
    1
  • Language
    Scala
  • Created almost 11 years ago
  • Updated almost 8 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

primesui

Primesui is a high performance web application which let you play with primes number. It can be deployed on any kind of application servers hosted on physical or virtual servers, on docker containers, on amazon web services, on openshift, ...

With caching enabled you can reach thousands of simultaneous users, and thousands of requests served every seconds. 7000 users, 11000 hit/s example with mysql, jetty, and gatling running on the same host (Linux gentoo, 6CPU, AMD II phenom X6 1090T).

This demo application also comes with a set of special features dedicated to experiments. Nine typical problems are simulated, from memory or jdbc connection leaks to poorly written logs.

This application relies on :

You can directly play with this application on this server : http://www.janalyse.org/primesui/, experiments features are disabled.

The latest primesui.war snapshot binary release (branch named develop) is available on http://www.janalyse.fr/primesui/primesui.war. Use this binary release, or build it by yourself as described in the next section.

You can easily run your own load tests on primesui using this github project. Just run sbt test from this project directory and your load tests will start. Several environment variables to configure or customize your test as described in the project page.

Build & Run locally

$ cd primes-scalatra-app
$ ./sbt
> jetty:start
> browse

If browse doesn't launch your browser, manually open http://localhost:8080/ in your browser.

Build & deploy to an application server

$ cd primes-scalatra-app
$ ./sbt package

It will generate a file such as : target/scala-2.11/primesui.war

For apache tomcat just drop this file to the following directory apache-tomcat/webapps/

Requirements

  • A running mysql database server. Without any configuration, primesui will try to connect to it using :
    • mysql host : 127.0.0.1
    • mysql database : primes
    • mysql username : optimus
    • mysql password : bumblebee
  • Connect to your database : mysql -h localhost -uroot -p
    • Create the required mysql user and database, using such sql commands :
    CREATE DATABASE primes;
    GRANT ALL PRIVILEGES ON primes.* TO 'optimus'@'localhost' identified by 'bumblebee' ;
    FLUSH PRIVILEGES;
    
  • All database tables and indexes will be automatically created if needed

Configuration

  • PRIMESUI_CACHE environment variable or java system properties can be used in order to control the initial state of the primes application cache (used or not used). If not set, the default value is false.
  • PRIMESUI_TESTING environment variable or java system property can be used to enable dangerous features that simulates problems (mem leak, slow requests, ...). If not set, the default value is true.
  • PRIMESUI_SESSION environment variable or java system property can be used to enable user sessions that will be used to store and show various user related data. This feature helps to test session affinity or application server clusters. If enabled, a message appears on the home page 'current user homepage hit count=x' If not set, the default is false.
  • PRIMESUI_DEBUG environment variable or java system property can be used to enable the DEBUG log level (if "true")
  • Database configuration
    • To specify a remote database using an externally defined data source :
      • Define a data source linked to "jdbc/primesui" jndi name.
      • any available external data source is used in priority over the default internal data source (C3P0 based)
    • To specify a remote database using the internal jdbc pool (c3p0), you can either use :
      • PRIMES_DB_HOST, PRIMES_DB_PORT and PRIMES_DB_NAME java system properties OR environment variables
      • If not set, primesui will try to use, either :
        • OPENSHIFT_MYSQL_DB_HOST and OPENSHIFT_MYSQL_DB_PORT environment variables (when used with Redhat openshift systems)
        • RDS_HOSTNAME, RDS_PORT, RDS_USERNAME, RDS_PASSWORD and RDS_DB_NAME environment variables (when used with AWS systems)
        • DOCKER_PRIMES_DB_PORT_\d+_TCP_ADDR, DOCKER_PRIMES_DB_PORT_\d+_TCP_PORT environment variables (when used with DOCKER systems)
      • defaults are : localhost, 3306 for the port, and primes for the database name

More Repositories

1

jassh

High level scala SSH API for easy and fast operations on remote servers.
Scala
71
star
2

code-examples-manager

Software tool to manage your notes, scripts, code examples, configs,... to publish them as gists or snippets
Scala
37
star
3

zio-lmdb

Lightning Memory Database (LMDB) for scala ZIO
Scala
36
star
4

jajmx

scala JMX API
Scala
31
star
5

sotohp

Photos management
Scala
27
star
6

scala-drools-dummy-project

Minimalist scala drools project
Scala
19
star
7

coursier-launcher

coursier docker container for efficient application or service download and startup
Makefile
9
star
8

zwords

A wordle game for communities
Scala
8
star
9

jaseries

scala API for time numerical series operations.
Scala
7
star
10

primes

Playing with primes using scala language. Draw Ulam spiral, ...
Scala
7
star
11

zio-worksheet

Simplified ZIO user experience in REPL, worksheet or script contexts
Scala
6
star
12

bootstrap

scala script bootstrap mechanism with #include support
Scala
6
star
13

the-weakest-link

Scala
4
star
14

custom-collection

Custom scala collection examples
Scala
4
star
15

scala-dummy-project

scala dummy project with standalone executable jar
Shell
3
star
16

drools-scripting

Drools made easy to use for scripting or testing purposes
Scala
2
star
17

codingame-with-scalakit-example

codingame scalakit example using git submodule to reference the scalakit
Scala
2
star
18

simple-plugin-architecture

Scala simple plugin architecture (with plugin automatic compilation if required)
Scala
2
star
19

exproxy

a 2005 personal project...
Java
2
star
20

cntlm

dockerized cntlm
Shell
2
star
21

naturalsort

scala naturalsort algorithm
Scala
1
star
22

web-echo

A websocket/webhook JSON data recorder with API
Scala
1
star
23

akka-sandbox

temporary project to test and learn AKKA 2
Scala
1
star
24

advent-of-code-2023

Scala
1
star
25

bullyboy

sha1 brute force attack
Scala
1
star
26

the-rules-for-good-code-examples

Several rules to write the best possible source code examples
1
star
27

data-recorder

Scala
1
star
28

advent-of-code-2020

Scala
1
star
29

jenkins-phantomjs-slave

jenkins slave with phantomjs 1.9 docker image
1
star
30

dock-primesui

Shell
1
star
31

jenkins

Jenkins docker image
Shell
1
star