Skip to content

Commit 812a648

Browse files
committed
Merge branch 'release/1.16.1'
2 parents 80c48a4 + 2e07a06 commit 812a648

3 files changed

Lines changed: 22 additions & 6 deletions

File tree

CHANGELOG.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
### Added
11+
12+
### Changed
13+
14+
### Fixed
15+
16+
## [1.16.1]
17+
18+
### Fixed
19+
- Fix routing in worker-pool.ts [#1187](https://github.com/PublicMapping/districtbuilder/pull/1187)
20+
21+
## [1.16.0]
22+
1023
### Added
1124
- Add color picker to reference layer flyout [#1150](https://github.com/PublicMapping/districtbuilder/pull/1150)
1225
- Add district type to project cards on 'My Maps' page [#1162](https://github.com/PublicMapping/districtbuilder/pull/1162)
@@ -467,7 +480,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
467480

468481
- Initial release.
469482

470-
[unreleased]: https://github.com/publicmapping/districtbuilder/compare/1.15.1...HEAD
483+
[unreleased]: https://github.com/publicmapping/districtbuilder/compare/1.16.1...HEAD
484+
[1.16.1]: https://github.com/publicmapping/districtbuilder/compare/1.16.0...1.16.1
485+
[1.16.0]: https://github.com/publicmapping/districtbuilder/compare/1.15.1...1.16.0
471486
[1.15.1]: https://github.com/publicmapping/districtbuilder/compare/1.15.0...1.15.1
472487
[1.15.0]: https://github.com/publicmapping/districtbuilder/compare/1.14.0...1.15.0
473488
[1.14.0]: https://github.com/publicmapping/districtbuilder/compare/1.13.0...1.14.0

src/server/src/healthcheck/healthcheck.controller.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export class HealthcheckController {
2626
const timeout = process.env.TYPEORM_HEALTH_CHECK_TIMEOUT
2727
? Number(process.env.TYPEORM_HEALTH_CHECK_TIMEOUT)
2828
: undefined;
29-
const maxRss = os.totalmem() * 0.9;
29+
const maxRss = os.totalmem() * 0.95;
3030
return this.health.check([
3131
() => this.db.pingCheck("database", { timeout }),
3232
() => this.topoLoaded.isHealthy("topology"),

src/server/src/worker-pool.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import { Functions, MergeArgs, TopologyMetadata } from "./worker";
1313
// Timeout after which we kill/recreate the worker thread
1414
const TASK_TIMEOUT_MS = 90_000;
1515

16-
// Reserve 5Gb + 30% of memory for responding to requests and loading topology data from disk
16+
// Reserve 6Gb + 35% of memory for responding to requests and loading topology data from disk
1717
// Remaining amount is split amongst each worker for topology data
1818
// This strategy seems to work for any amount of host memory and targets total memory
1919
// in use maxing out at around 80%
@@ -22,7 +22,7 @@ const dockerMemLimit = Number(
2222
);
2323
const hostmem = os.totalmem();
2424
const totalmem = Math.min(hostmem, dockerMemLimit);
25-
const reservedMem = 5 * 1024 * 1024 * 1024 + totalmem * 0.3;
25+
const reservedMem = 6 * 1024 * 1024 * 1024 + totalmem * 0.35;
2626
const maxCacheSize = Math.ceil((totalmem - reservedMem) / NUM_WORKERS);
2727

2828
const logger = new Logger("worker-pool");
@@ -83,13 +83,14 @@ async function findQueue(
8383
const size = regionSizes[regionConfig.id];
8484

8585
// Choose our next index by size
86+
const willFit = (worker: number) => workerSizes[worker] + size < maxCacheSize;
8687
const getBestFit = (workers: number[]): number =>
8788
(!size
8889
? // Use the smallest worker if size is unknown
8990
_.minBy(workers, idx => workerSizes[idx])
9091
: // Use the largest worker that will fit if size is known
91-
workerSizes.some(workerSize => workerSize + size < maxCacheSize)
92-
? _.minBy(workers, idx => maxCacheSize - (workerSizes[idx] + size))
92+
workers.some(willFit)
93+
? _.minBy(workers.filter(willFit), idx => maxCacheSize - (workerSizes[idx] + size))
9394
: // If no workers will fit, we use the least recently used worker
9495
// eslint-disable-next-line functional/immutable-data
9596
workersByRecency.pop()) || workers[0];

0 commit comments

Comments
 (0)