Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/blackbox.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Install dependencies
run: composer install --prefer-dist --no-interaction --no-suggest
run: composer install --prefer-dist --no-interaction

- name: Compose Blackbox environment
run: docker compose up -d
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
coverage: none

- name: Install dependencies
run: composer install --prefer-dist --no-interaction --no-suggest
run: composer install --prefer-dist --no-interaction
- name: Run PHP Code Sniffer
run: ./vendor/bin/phpcs

Expand Down Expand Up @@ -58,6 +58,6 @@ jobs:
tools: "cs2pr"

- name: Install dependencies
run: composer install --prefer-dist --no-interaction --no-suggest
run: composer install --prefer-dist --no-interaction
- name: Run PHPStan
run: "vendor/bin/phpstan analyse --autoload-file tests/bootstrap.php --error-format=checkstyle | cs2pr"
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ jobs:
coverage: none

- name: Install dependencies
run: composer update --prefer-dist --no-interaction --no-suggest
run: composer update --prefer-dist --no-interaction

- name: Start Redis
uses: supercharge/[email protected]
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/vendor/
*.iml
/.idea/
composer.lock
composer.phar
.phpunit.result.cache
2 changes: 1 addition & 1 deletion README.APCng.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ The following table compares `APC` and `APCng` processing time for a series of o
| APCng 100k keys / 2500 metrics | 274.7 | 84.0 | 34.6 | 4092.4 | 52.9x |
| APCng 1M keys / 2500 metrics | 187.8 | 87.7 | 40.7 | 5396.4 | 50.1x |

The suite of engine-performance tests can be automatically executed by running `docker-compose run phpunit vendor/bin/phpunit tests/Test --group Performance`. This set of tests in not part of the default unit tests which get run, since they take quite a while to complete. Any significant change to the APC or APCng code should be followed by a performance-test run to quantify the before/after impact of the change. Currently this is triggered manually, but it could be automated as part of a Github workflow.
The suite of engine-performance tests can be automatically executed by running `docker compose run phpunit vendor/bin/phpunit tests/Test --group Performance`. This set of tests in not part of the default unit tests which get run, since they take quite a while to complete. Any significant change to the APC or APCng code should be followed by a performance-test run to quantify the before/after impact of the change. Currently this is triggered manually, but it could be automated as part of a Github workflow.

## Known limitations
One thing to note, the current implementation of the `Summary` observer should be avoided on busy servers. This is true for both the `APC` and `APCng` storage engines. The reason is simple: each observation (call to increment, set, etc) results in a new item being written to APCu. The default TTL for these items is 600 seconds. On a busy server that might be getting 1000 requests/second, that results in 600,000 APC cache items continually churning in and out of existence. This can put some interesting pressure on APCu, which could lead to rapid fragmentation of APCu memory. Definitely test before deploying in production.
Expand Down
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ composer require promphp/prometheus_push_gateway_php

Start a Redis instance:
```
docker-compose up redis
docker compose up redis
```

Run the tests:
Expand All @@ -157,16 +157,16 @@ composer install

## Black box testing

Just start the nginx, fpm & Redis setup with docker-compose:
Just start the nginx, fpm & Redis setup with Docker Compose:
```
docker-compose up
docker compose up
```
Pick the adapter you want to test.

```
docker-compose run phpunit env ADAPTER=apc vendor/bin/phpunit tests/Test/
docker-compose run phpunit env ADAPTER=apcng vendor/bin/phpunit tests/Test/
docker-compose run phpunit env ADAPTER=redis vendor/bin/phpunit tests/Test/
docker compose run phpunit env ADAPTER=apc vendor/bin/phpunit tests/Test/
docker compose run phpunit env ADAPTER=apcng vendor/bin/phpunit tests/Test/
docker compose run phpunit env ADAPTER=redis vendor/bin/phpunit tests/Test/
```

## Performance testing
Expand All @@ -178,6 +178,6 @@ phpunit vendor/bin/phpunit tests/Test/ --group Performance

The test can also be run inside a container.
```
docker-compose up
docker-compose run phpunit vendor/bin/phpunit tests/Test/ --group Performance
docker compose up
docker compose run phpunit vendor/bin/phpunit tests/Test/ --group Performance
```
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@
},
"require-dev": {
"guzzlehttp/guzzle": "^6.3|^7.0",
"phpstan/extension-installer": "^1.0",
"phpstan/phpstan": "^1.5.4",
"phpstan/phpstan-phpunit": "^1.1.0",
"phpstan/phpstan-strict-rules": "^1.1.0",
"phpstan/extension-installer": "^1.4",
"phpstan/phpstan": "^2.1",
"phpstan/phpstan-phpunit": "^2.0",
"phpstan/phpstan-strict-rules": "^2.0",
"phpunit/phpunit": "^9.4",
"squizlabs/php_codesniffer": "^3.6",
"symfony/polyfill-apcu": "^1.6"
Expand Down
Loading
Loading