bearsunday / bearsunday.github.io

BEAR.Sunday manual
https://bearsunday.github.io/
10 stars 48 forks source link

ブートストラップのパフォーマンスチューニングを追加 #275

Closed koriym closed 5 months ago

koriym commented 5 months ago

Updated the English version, which had not been able to keep up with the Japanese version.

coderabbitai[bot] commented 5 months ago

ウォークスルー

BEAR.SundayフレームワークのProdModuleに関するアップデート、エラーページとキャッシュのカスタマイズ、ロギングの強化、デプロイメントのベストプラクティス、そしてパフォーマンスの最適化が含まれています。これらの変更は、プロダクション環境の設定とパフォーマンス向上に焦点を当てています。

変更

ファイル 変更の概要
manuals/1.0/.../160.production.md (en/ja) ProdModuleのアップデート、エラーページと分散キャッシュのカスタマイズ、キャッシュ設定、ロギング強化、デプロイメントのベストプラクティス、パフォーマンスチューニングの推奨。日本語版では、immutable_cache PECLパッケージを使用したブートストラップのパフォーマンスチューニングが追加されています。

Recent Review Details **Configuration used: CodeRabbit UI** **Review profile: CHILL**
Commits Files that changed from the base of the PR and between 0ecec72b34caab1d9336b533b744bc1fee8605ce and cb6e5615e7f68433353a444e07cf66b127421d85.
Files selected for processing (2) * manuals/1.0/en/160.production.md (5 hunks) * manuals/1.0/ja/160.production.md (1 hunks)
Additional Context Used
LanguageTool (47)
manuals/1.0/en/160.production.md (45)
Near line 9: Add a space between sentences. Context: ...duction.html --- # Production For BEAR.Sunday's default `prod` binding, the applicati... --- Near line 11: Possible spelling mistake found. Context: ...) and performs the binding. ## Default ProdModule The default `prod` binding binds the f... --- Near line 13: You’ve repeated a verb. Did you mean to only write one of them? Context: ... Default ProdModule The default `prod` binding binds the following interfaces: * Error page... --- Near line 20: Add a space between sentences. Context: ...* Distributed cache See [ProdModule.php](https://github.com/bearsunday/BEAR.Package/blob/1.x/src/Context/ProdModule.php) in... --- Near line 20: Add a space between sentences. Context: ...1.x/src/Context/ProdModule.php) in BEAR.Package for details. ## Application's ProdModu... --- Near line 22: Possible spelling mistake found. Context: ....Package for details. ## Application's ProdModule Customize the application's `ProdModul... --- Near line 24: Possible spelling mistake found. Context: ...ProdModule Customize the application's `ProdModule` in `src/Module/ProdModule.php` against... --- Near line 24: Possible spelling mistake found. Context: ...ule/ProdModule.php` against the default ProdModule. Error pages and distributed caches are... --- Near line 55: Possible spelling mistake found. Context: ...le web servers. Both caches default to [PhpFileCache](https://www.doctrine-project.org/proje... --- Near line 64: Possible spelling mistake found. Context: ...uired. Modules for each of the popular [memcached](http://php.net/manual/en/book.memcache... --- Near line 110: Possible spelling mistake found. Context: ...ime To change the default TTL, install `StorageExpiryModule`. ```php?start_inline // Cache time $s... --- Near line 127: Possible spelling mistake found. Context: ...ent to assign a time or random value to `$cacheVersion` so that no change is required. ## Log... --- Near line 131: This sentence does not start with an uppercase letter. Context: ...quired. ## Logging `ProdLoggerModule` is a resource execution log module for pro... --- Near line 131: Possible spelling mistake found. Context: ...s other than GET to the logger bound to `Psr\Log\LoggerInterface`. If you want to log on a specific reso... --- Near line 132: Possible spelling mistake found. Context: ...te, bind a custom log to [BEAR\Resource\LoggerInterface](https://github.com/bearsunday/BEAR.Res... --- Near line 132: Add a space between sentences. Context: ...om log to [BEAR\Resource\LoggerInterface](https://github.com/bearsunday/BEAR.Resource/blob/1.x/src/LoggerInterface.php). ```... --- Near line 147: Possible spelling mistake found. Context: ... } } ``` The `__invoke` method of [LoggerInterface](https://github.com/bearsunday/BEAR.Res... --- Near line 147: Add a space between sentences. Context: ...he `__invoke` method of [LoggerInterface](https://github.com/bearsunday/BEAR.Resource/blob/1.x/src/LoggerInterface.php) passe... --- Near line 147: Possible spelling mistake found. Context: ...he resource URI and resource state as a `ResourceObject` object, so log the necessary parts bas... --- Near line 148: Possible spelling mistake found. Context: .... Refer to the [existing implementation ProdLogger](https://github.com/bearsunday/BEAR.Res... --- Near line 148: Add a space between sentences. Context: ... the [existing implementation ProdLogger](https://github.com/bearsunday/BEAR.Resource/blob/1.x/src/ProdLogger.php) for creati... --- Near line 156: Possible typo: you repeated a whitespace Context: ...can exceed capacity on high-load sites. Set up in a separate directory for safet... --- Near line 158: Add a space between sentences. Context: ... is successful. * You can use the [BEAR.Sunday recipe](https://github.com/bearsunday/d... --- Near line 158: Possible spelling mistake found. Context: ...tps://github.com/bearsunday/deploy) of [Deployer](http://deployer.org/). #### When depl... --- Near line 162: Possible missing comma found. Context: ...mmended to incorporate compilation into CI as the compiler outputs exit code 1 whe... --- Near line 172: Possible spelling mistake found. Context: ... When compiling multiple contexts (ex. api-app, html-app) in one application, such as ... --- Near line 172: Possible spelling mistake found. Context: ...mpiling multiple contexts (ex. api-app, html-app) in one application, such as when perfo... --- Near line 178: Possible spelling mistake found. Context: ...toload.php api.autoload.php ``` Edit `composer.json` to change the content of `composer com... --- Near line 180: This sentence does not start with an uppercase letter. Context: ...the content of `composer compile`. ### autoload.php An optimized autoload.php file is ... --- Near line 183: Possible spelling mistake found. Context: ...er than `vendor/autoload.php` output by `composer dumpa-autoload --optimize`. Note: If you use `preload... --- Near line 187: This sentence does not start with an uppercase letter. Context: ...utload.php` generated by Composer. ### preload.php An optimized preload.php file is o... --- Near line 192: Unpaired symbol: ‘(’ seems to be missing Context: ...t version of `7.4.4` or higher. Example) ``` opcache.preload=/path/to/project/p... --- Near line 199: Add a space between sentences. Context: ...`` Note: Please refer to the [benchmark](https://github.com/bearsunday/BEAR.HelloworldBenchmark/wiki/Intel-Core-i5-3.8-GHz-iMac-(Retina... --- Near line 204: Possible spelling mistake found. Context: ...n-production environments (for example, ResourceObjects that cannot be injected unless authenti... --- Near line 217: Possible spelling mistake found. Context: ...u can convert it to an image file with [graphviz](https://graphviz.org/) or use [Graphvi... --- Near line 217: Possible spelling mistake found. Context: ...raphviz](https://graphviz.org/) or use [GraphvizOnline](https://dreampuf.github.io/GraphvizOnl... --- Near line 226: This sentence does not start with an uppercase letter. Context: ... ``` ## Bootstrap Performance Tuning [immutable_cache](https://pecl.php.net/package/imm... --- Near line 226: Unpaired symbol: ‘[’ seems to be missing Context: ...rap Performance Tuning [immutable_cache](https://pecl.php.net/package/immutable_... --- Near line 226: Possible spelling mistake found. Context: ...values in shared memory. It is based on APCu but is faster than APCu because it stor... --- Near line 226: Possible spelling mistake found. Context: ... It is based on APCu but is faster than APCu because it stores immutable values such... --- Near line 226: Possible spelling mistake found. Context: ...emory. Additionally, installing PECL's [Igbinary](https://www.php.net/manual/en/book.igb... --- Near line 226: Possible spelling mistake found. Context: ...anual/en/book.igbinary.php) with either APCu or immutable_cache can reduce memory us... --- Near line 228: Possible spelling mistake found. Context: ...he adapters available. Please refer to [ImmutableBootstrap](https://github.com/koriym/BEAR.Hello/c... --- Near line 228: Add a space between sentences. Context: ...ble. Please refer to [ImmutableBootstrap](https://github.com/koriym/BEAR.Hello/commit/507d1ee3ed514686be2d786cdaae1ba8... --- Near line 230: This sentence does not start with an uppercase letter. Context: ...s and achieve maximum performance. ### php.ini ``` // Extensions extension="apcu....
manuals/1.0/ja/160.production.md (2)
Near line 167: 「ことができる」という表現は冗長な可能性があります。 Context: ...ar.compile`スクリプトを使ってプロジェクトを**ウオームアップ**することができます。 コンパイルスクリプトはDI/AOP用の動的に作成されるファイルやアノテー... --- Near line 229: 「ことができる」という表現は冗長な可能性があります。 Context: ...作成し呼び出してください。初期化コストを最小限に抑え、最大のパフォーマンスを得ることができます。 ### php.ini ``` // エクステンション extens...
Additional comments not posted (4)
manuals/1.0/ja/160.production.md (2)
`225-230`: immutable_cacheの導入に関する説明が追加されましたが、専用のキャッシュアダプターがないことを明確にしています。これにより、ユーザーはカスタムブートストラップの作成を検討する必要があります。この変更は、初期化コストを最小限に抑えることを目的としています。 --- `233-242`: php.iniの設定に関する新しいセクションが追加されました。ここでは、`immutable_cache`と`igbinary`の使用によるパフォーマンス向上が説明されています。これらの設定は、システムのメモリ使用量を削減し、処理速度を向上させることが期待されます。
manuals/1.0/en/160.production.md (2)
`224-230`: The introduction of the `immutable_cache` PECL package is well-explained, highlighting its advantages over APCu in terms of speed and efficiency when handling immutable PHP objects and arrays. This section effectively guides users on how to leverage this new tool to enhance performance. --- `232-242`: A new section on php.ini settings has been added, detailing the configuration necessary to optimize performance using `immutable_cache` and `igbinary`. These settings are crucial for reducing memory usage and speeding up operations, which is beneficial for production environments.
--- Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Share - [X](https://twitter.com/intent/tweet?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A&url=https%3A//coderabbit.ai) - [Mastodon](https://mastodon.social/share?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A%20https%3A%2F%2Fcoderabbit.ai) - [Reddit](https://www.reddit.com/submit?title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&text=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code.%20Check%20it%20out%3A%20https%3A//coderabbit.ai) - [LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fcoderabbit.ai&mini=true&title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&summary=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code)
Tips ### Chat There are 3 ways to chat with [CodeRabbit](https://coderabbit.ai): - Review comments: Directly reply to a review comment made by CodeRabbit. Example: - `I pushed a fix in commit .` - `Generate unit testing code for this file.` - `Open a follow-up GitHub issue for this discussion.` - Files and specific lines of code (under the "Files changed" tab): Tag `@coderabbitai` in a new review comment at the desired location with your query. Examples: - `@coderabbitai generate unit testing code for this file.` - `@coderabbitai modularize this function.` - PR comments: Tag `@coderabbitai` in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples: - `@coderabbitai generate interesting stats about this repository and render them as a table.` - `@coderabbitai show all the console.log statements in this repository.` - `@coderabbitai read src/utils.ts and generate unit testing code.` - `@coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.` Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. ### CodeRabbit Commands (invoked as PR comments) - `@coderabbitai pause` to pause the reviews on a PR. - `@coderabbitai resume` to resume the paused reviews. - `@coderabbitai review` to trigger a review. This is useful when automatic reviews are disabled for the repository. - `@coderabbitai resolve` resolve all the CodeRabbit review comments. - `@coderabbitai help` to get help. Additionally, you can add `@coderabbitai ignore` anywhere in the PR description to prevent this PR from being reviewed. ### CodeRabbit Configration File (`.coderabbit.yaml`) - You can programmatically configure CodeRabbit by adding a `.coderabbit.yaml` file to the root of your repository. - Please see the [configuration documentation](https://docs.coderabbit.ai/guides/configure-coderabbit) for more information. - If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: `# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json` ### Documentation and Community - Visit our [Documentation](https://coderabbit.ai/docs) for detailed information on how to use CodeRabbit. - Join our [Discord Community](https://discord.com/invite/GsXnASn26c) to get help, request features, and share feedback. - Follow us on [X/Twitter](https://twitter.com/coderabbitai) for updates and announcements.