This repository has been archived by the owner on Jan 13, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 45
Adding command line parameter to specify the number of HHVM Server Th… #80
Merged
mofarrell
merged 9 commits into
facebookarchive:master
from
kevand900:threadsAndConcurrency2
Mar 22, 2017
Merged
Changes from 5 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
f6fda31
Adding command line parameters to change the number of hhvm server th…
dbe54f8
Adding command line parameter to specify the number of HHVM Server Th…
4d81437
Adding command line parameters to specify the number of ServerThreads…
d3551fb
Made it so we do not have to use --i-am-not-benchmarking for --server…
705bffd
Resolved review comments.
34c9809
Resolved review comments.
7f777c6
Resolving requested changes.
kevand900 23a0b1b
Merge remote-tracking branch 'upstream/master' into threadsAndConcurr…
kevand900 7bbe893
Resolving requested changes, made pm.max_children variable.
kevand900 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -107,6 +107,8 @@ final class PerfOptions { | |
public ?string $scriptBeforeWarmup; | ||
public ?string $scriptAfterWarmup; | ||
public ?string $scriptAfterBenchmark; | ||
public ?string $serverThreads; | ||
public ?string $clientThreads; | ||
|
||
public bool $notBenchmarking = false; | ||
|
||
|
@@ -166,6 +168,8 @@ public function __construct(Vector<string> $argv) { | |
'daemon-files', // daemon output goes to files in the temp directory | ||
'temp-dir:', // temp directory to use; if absent one in /tmp is made | ||
'src-dir:', // location for source to copy into tmp dir instead of ZIP | ||
'server-threads:', | ||
'client-threads:', | ||
}; | ||
$targets = $this->getTargetDefinitions()->keys(); | ||
$def->addAll($targets); | ||
|
@@ -291,7 +295,17 @@ public function __construct(Vector<string> $argv) { | |
$this->daemonOutputToFile = $this->getBool('daemon-files'); | ||
|
||
$argTempDir = $this->getNullableString('temp-dir'); | ||
|
||
if(array_key_exists('server-threads', $o)){ | ||
$this->serverThreads = $this->args['server-threads']; | ||
$this->hhvmExtraArguments[count($this->hhvmExtraArguments)] = '-dhhvm.server.thread_count='.$this->serverThreads; | ||
} | ||
|
||
if(array_key_exists('client-threads', $o)){ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This also needs a default. |
||
$this->clientThreads = $this->args['client-threads']; | ||
PerfSettings::setBenchmarkConcurrency((int)$this->clientThreads); | ||
} | ||
|
||
if ($argTempDir === null) { | ||
$this->tempDir = tempnam('/tmp', 'hhvm-nginx'); | ||
// Currently a file - change to a dir | ||
|
@@ -302,7 +316,6 @@ public function __construct(Vector<string> $argv) { | |
} | ||
|
||
$this->srcDir = $this->getNullableString('src-dir'); | ||
|
||
} | ||
|
||
public function validate() { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,7 @@ | |
final class PerfSettings { | ||
|
||
///// Benchmark Settings ///// | ||
private static int $benchmarkConcurrency = 200; | ||
|
||
// Per concurrent thread - so, total number of requests made during warmup | ||
// is WarmupRequests * WarmupConcurrency | ||
|
@@ -28,8 +29,12 @@ public static function BenchmarkTime(): string { | |
return '1M'; // 1 minute | ||
} | ||
|
||
public static function setBenchmarkConcurrency(int $toSet): void { | ||
PerfSettings::$benchmarkConcurrency = $toSet; | ||
} | ||
|
||
public static function BenchmarkConcurrency(): int { | ||
return 200; | ||
return PerfSettings::$benchmarkConcurrency; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we actually remove benchmark concurrency settings here, and use the options instead in |
||
} | ||
|
||
///// Server Settings ///// | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
serverThreads
should be set by default to 100, and it should be removed from the config files https://github.com/hhvm/oss-performance/blob/master/conf/php.ini#L20. Probably don't use the hhvm extra args for this, and just add another argument in https://github.com/hhvm/oss-performance/blob/master/base/HHVMDaemon.php#L70