processone/tsung — pull request #102 by tisba (2014-08-21 13:29:11+00:00)
Title: Fix RNG seeding

During a load test with high arrival rates, I noticed a lot of collisions of generated random strings. The collision rate was quite **reproducible at about 2%**.

The pull requests adds the tsung user id to the seed initialization used in `ts_client:init/1`.

Additionally, providing a fixed seed via `
` also causes collisions across clients. In fact the collision rate was significantly higher (see below).

In my opinion both issues are severe, since you have to rely on the fact, that the randomness is strong enough. Collisions rates

The following configuration can be used to reproduce the issue and validate the changes. Using this configuration, you'll see collision rates up to **7%** (against https://github.com/processone/tsung/tree/924b5170533a09e7f404b3875b85129104e9312b)

## Test Configuration

```xml

```

## Reproduce and Count Duplicates/Collisions

```
$ /tmp/tsung/bin/tsung -f ./randomness_test.xml -l ./logs start >| test_seed.out
$ tail -n +3 test_seed.out | sort | uniq | wc -l ; tail -n +3 test_seed.out | wc -l
```

For the current master and a fixed seed, this gives me `1152` and `100000`, which means **98.848% of all generated strings are duplicated values!**. Without a fixed seed, `91409` and `100000`, which correlates to about 8.59%.

When this pull request is applied, you'll see **0 duplicates**.