#APCU
Explore tagged Tumblr posts
polyphonetic · 1 year ago
Text
For some reference on how I did it!
https://m.mediawiki.org/wiki/Manual:Installing_MediaWiki
The above was the main tutorial I used! The main parts for me was installing XAMPP, using Apache through the XAMPP console, and then separately using MariaDB *instead of* MySQL (which is in the XAMPP console). When creating the database in MariaDB, use the collation "utf8mb4_unicode_520_ci" instead.
https://m.mediawiki.org/wiki/Manual:Installing_MediaWiki_on_XAMPP
https://m.mediawiki.org/wiki/Manual:MariaDB
tutorial for XAMPP setup and ImageMagick [note that this uses XAMPP's MySQL, my process used MariaDB]:
https://youtube.com/watch?v=PoL_XxhsYRo
For APCu (which is related to caching and speeding up browsing), in XAMPP's php.ini file you'll want to make sure to have 'extension=apcu'. The below page was a big help on making sure you're using the right version, especially the top comment. that phpinfo() command part just literally make a text file with it, save as .php file through like notepad or notepad++, put it in your main folder for your wiki, open localhost to it
https://www.php.net/manual/en/book.apcu.php
Essentially when you get to the "installing the wiki" step, I tried to have ImageMagick and APCu ready and set up and showing that they're installed. I also looked into installing diff3 and File, but you do it after installation of your server when the LocalSettings.php has been created. Info is for some reason
https://m.mediawiki.org/wiki/Manual:Installing_MediaWiki_on_Windows_Server_2008_R2#GNU_diff3_Installation_.28Optional.29
This was a two-day project for me so don't fret if it takes a while to figure out. I hope though that this collection of links expedites the "googling around figuring out what the fuck anything is" stage.
There are many cool extensions you can do with MediaWiki and you can create a forum or a blog on it or just use it for whatever! I just think it feels so cool. Look around at other wikis to see how their CSS is done
MediaWiki:Common.css
https://m.mediawiki.org/wiki/Manual:CSS
https://en.touhouwiki.net/wiki/Touhou_Wiki
https://en.touhouwiki.net/wiki/MediaWiki:Common.css
https://wiki.puella-magi.net/Main_Page
https://wiki.puella-magi.net/MediaWiki:Common.css
YIPPEE I figured out how to host a WIKI on my COMPUTER with PHP and SQL!!!! I am gonna put so much world-building lore in this thing once I figure out some CSS
I can't say anything about the project but aaaaah I am. Excited. I have been wiggling this story concept in my head for like 4 years and am ready to spew them onto my computer much like raw unprocessed ore
45 notes · View notes
punk-cat-punk · 21 days ago
Text
Grokに質問してみた
【質問】以下の環境でWordPressサイトを運用するものとします。
仮想4コア メモリ8GB Debian12 Lighttpd 1.4.69 MariaDB 10.11.11 php-fpm 8.4.7
WPのキャッシュプラグインは WP Super Cache を利用します(Lighttpdとの連携でluaスクリプト使用)。PHPのキャッシュ機能としてはAPCuとOPcacheを使います。OPcacheではJITの機能も使いたいです。この場合、MariaDB/PHP/APCu/OPcacheのメモリ周りで推奨される設定内容を教えてください。
【回答】WordPressサイトを以下の環境で運用する際の、MariaDB��PHP、APCu、OPcacheのメモリ関連の推奨設定を以下にまとめます。環境は仮想4コア、メモリ8GB、Lighttpd 1.4.69、MariaDB 10.11.11、PHP-FPM 8.4.7、WP Super Cache(Luaスクリプト使用)、APCuおよびOPcache(JIT有効)です。メモリ割り当ては、システム全体のバランスを考慮し、WordPressの負荷や同時接続数を一般的な中規模サイト(月間10万PV程度、同時接続20~50程度)を想定して提案します。
1. MariaDBのメモリ関連設定
MariaDBはデータベースサーバーとしてメモリを多く消費するため、適切なチューニングが重要です。8GBのメモリのうち、MariaDBに割り当てるのは全体の約30~40%(2.5~3.2GB)を目安にします。以下は /etc/my.cnf または /etc/mysql/mariadb.cnf に記載する推奨設定です。
推奨設定
ini
[mysqld]
# InnoDB関連 innodb_buffer_pool_size = 2G # InnoDBのデータとインデックスをキャッシュ。全体のメモリの25%程度。 innodb_log_file_size = 256M # ログファイルサイズ。バッファプールの1/8程度。 innodb_flush_log_at_trx_commit = 2 # トランザクションの書き込みを遅延させ、性能向上。 innodb_file_per_table = 1 # 各テーブルを個別ファイルに保存。
# クエリキャッシュ(MariaDB 10.11では非推奨だが、軽量利用なら有効) query_cache_type = 0 # クエリキャッシュは基本無効化(WP Super Cache使用のため不要)。 query_cache_size = 0
# その他のメモリ設定 table_open_cache = 2000 # オープンするテーブルのキャッシュ数。 table_definition_cache = 1400 # テーブル定義のキャッシュ。 tmp_table_size = 64M # 一時テーブルのサイズ。 max_heap_table_size = 64M # ヒープテーブルの最大サイズ。 join_buffer_size = 256K # ジョイン操作用のバッファ。 sort_buffer_size = 256K # ソート操作用のバッファ。 read_rnd_buffer_size = 128K # ランダムリード用のバッファ。
# 接続関連 max_connections = 100 # 同時接続数。WordPressでは50~100で十分。 thread_cache_size = 50 # スレッド再利用のためのキャッシュ。
ポイント
innodb_buffer_pool_size: メモリ全体の25~30%を割り当て。WordPressはInnoDB中心のため、これが最も重要。
クエリキャッシュ: WP Super Cacheがページキャッシュを担うため、MariaDBのクエリキャッシュは無効化してメモリを節約。
接続数: 同時接続数を抑え、PHP-FPMやLighttpdとのバランスを取る。
チューニングの注意: 高負荷時には mysql tuner を使って1~2週間運用後に調整を推奨。
2. PHP(PHP-FPM)のメモリ関連設定
PHP-FPMはWordPressの処理を担当し、メモリ消費はプロセス数と各プロセスのメモリ使用量に依存します。8GBのメモリのうち、PHP-FPMには1.5~2GB程度を割り当てます。
推奨設定
/etc/php/8.4/fpm/php-fpm.conf または /etc/php-fpm.d/www.conf に以下を設定。
ini
[www]
pm = dynamic # 動的プロセス管理。 pm.max_children = 20 # 最大プロセス数。1プロセスあたり約50~80MB消費。 pm.start_servers = 5 # 起動時のプロセス数。 pm.min_spare_servers = 5 # 最小待機プロセス数。 pm.max_spare_servers = 10 # 最大待機プロセス数。 pm.max_requests = 500 # プロセス再起動までのリクエスト数。
# メモリ制限 php_admin_value[memory_limit] = 128M # 1プロセスあたりの最大メモリ。WordPressでは128Mで十分。
ポイント
pm.max_children: 仮想4コア、8GBメモリを考慮し、20程度に設定。1プロセスあたり約50~80MB消費を想定。
memory_limit: WordPressのプラグインやテーマによっては128Mで十分。重いプラグイン使用時は256Mに増やすことも検討。
pm.max_requests: メモリリーク防止のため、一定リクエスト後にプロセスを再起動。
モニタリング: 負荷状況に応じて htop や pm.status でプロセス数を確認し、調整。
3. APCuのメモリ関連設定
APCuはオブジェクトキャッシュとしてWordPressのクエリ負荷を軽減します。WP Super Cacheと連携するため、適度なメモリ割り当てが必要です。
推奨設定
/etc/php/8.4/mods-available/apcu.ini に以下を設定。
ini
[apcu]
apc.enabled = 1 apc.shm_size = 128M # APCuの共有メモリサイズ。128Mで中規模サイトに対応。 apc.ttl = 7200 # キャッシュの有効期限(秒)。2時間。 apc.gc_ttl = 3600 # ガベージコレクションの有効期限。 apc.enable_cli = 0 # CLIでのAPCu無効化(不要なメモリ消費を防ぐ)。 apc.entries_hint = 4096 # キャッシュエントリの最大数。
ポイント
apc.shm_size: 128MでWordPressの中規模サイト(プラグイン10~20個程度)に対応。メモリに余裕があれば256Mも検討。
ttlとgc_ttl: キャッシュの鮮度を保ちつつ、メモリを効率的に利用。
モニタリング: APCuのヒット率を apc.php(APCuに付属のモニタリングスクリプト)で確認し、ヒット率が90%以下なら shm_size を増やす。
4. OPcache(JIT含む)のメモリ関連設定
OPcacheはPHPコードをキャッシュし、実行速度を向上させます。JIT(Just-In-Timeコンパイル)を有効にする場合、追加のメモリが必要ですが、WordPressでは効果が限定的な場合もあります。
推奨設定
/etc/php/8.4/mods-available/opcache.ini に以下を設定。
ini
[opcache]
opcache.enable = 1 opcache.memory_consumption = 256M # OPcacheのメモリサイズ。256Mで十分。 opcache.interned_strings_buffer = 16 # 文字列インターン用のメモリ(MB)。 opcache.max_accelerated_files = 10000 # キャッシュ可能なファイル数。 opcache.revalidate_freq = 2 # キャッシュの更新頻度(秒)。 opcache.validate_timestamps = 1 # ファイル変更をチェック。 opcache.save_comments = 1 # コメントを保存(WordPressのプラグインで必要)。 opcache.enable_file_override = 0 # ファイルオーバーライドは無効。
# JIT設定 opcache.jit = 1255 # JITを有効化(tracing JIT)。 opcache.jit_buffer_size = 64M # JIT用のバッファサイズ。 opcache.jit_cranelimit = 0 # JITのクレーン制限(デフォルト)。
ポイント
opcache.memory_consumption: WordPressの中規模サイトでは256Mで十分。プラグインやテーマが多い場合は512Mも検討。
opcache.max_accelerated_files: テーマやプラグインのPHPファイル数を考慮し、10000に設定。
JIT設定: opcache.jit=1255 はトレーシングJITを有効化。jit_buffer_size は64Mで十分だが、負荷テストで効果が低い場合は無効化(opcache.jit=0)も検討。
モニタリング: opcache_get_status() を使ってキャッシュヒット率やメモリ使用量を確認。ヒット率が95%以下なら memory_consumption を増やす。
全体のメモリ割り当ての目安
以下は8GBメモリでの割り当て例です:
OSおよびLighttpd: 1~1.5GB(システムやWebサーバーの基本消費)
MariaDB: 2.5~3GB(主に innodb_buffer_pool_size)
PHP-FPM: 1.5~2GB(プロセス数×memory_limit)
APCu: 128M
OPcache: 256M(JIT含む)
余剰メモリ: 0.5~1GB(スワップ防止のためのバッファ)
追加の考慮事項
LighttpdとLuaスクリプト: WP Super CacheのLuaスクリプトが正しく設定されているか確認。キャッシュヒット率を高めるため、静的ファイル(CSS、JS、画像)はLighttpdで直接配信する設定を推奨。
モニタリングツール: htop、iotop、MySQLTuner、PHPの opcache_get_status()、APCuの apc.php を使って、メモリ使用量やキャッシュヒット率を定期的に確認。
スワップ防止: /proc/meminfo や free -m でスワップ使用を確認。スワップが発生する場合は、PHP-FPMの max_children やMariaDBの innodb_buffer_pool_size を減らす。
負荷テスト: ab や siege を使って負荷テストを行い、同時接続数やレスポンス時間を確認。必要に応じて設定を微調整。
バックアップ: 設定変更前に /etc/my.cnf や /etc/php/8.4/ の設定ファイルをバックアップ。
補足
想定負荷の調整: 月間PVや同時接続数が異なる場合(例:高負荷サイトなら50万PV以上、同時接続100以上)、pm.max_children や innodb_buffer_pool_size を増やす必要あり。具体的な負荷情報があれば教えてください。
JITの効果: WordPressではJITの恩恵が限定的な場合があるため、運用後にベンチマーク(例:ab -n 1000 -c 50)で効果を測定し、無効化も検討。
セキュリティ: PHP-FPMやMariaDBの設定変更後は、権限(chmod、chown)やファイアウォール設定を確認。
この設定で中規模WordPressサイトの安定運用が可能ですが、具体的なトラフィックやプラグイン構成に応じて調整が必要な場合があります。追加情報や具体的な負荷状況を教えていただければ、さらに最適化の提案が可能です!
0 notes
kodumunoglu · 2 months ago
Link
0 notes
evillesbianvillain · 3 months ago
Text
Mi fa molto ridere che Fabrizio Gifuno ha fatto Aldo Moro sia in Romanzo di una strage che Esterno notte. APCU (anni di piombo cinematic universe)
0 notes
iconsofchange · 4 months ago
Text
Tumblr media
Join Us for IoCPTV’s "The People's Platform: Every Candidate, Every Voice" featuring Atty. Raul Loyola Lambino
Event Overview: Icons of Change invites you to a thought-provoking discussion with Atty. Raul Loyola Lambino on February 12, 2025, at 8:30 PM. A respected lawyer, public servant, and policy expert, Atty. Lambino has played a crucial role in shaping economic and political strategies in the Philippines. As the Chairman of the Association for Philippines-China Understanding (APCU) and former Presidential Adviser for Northern Luzon, he has been at the forefront of initiatives promoting economic growth, international relations, and political reforms.
With decades of experience in law, governance, and diplomacy, Atty. Lambino brings a deep understanding of key national issues, including federalism, economic development, and foreign relations.
Why It Matters: In an ever-changing global and national landscape, sound economic policies, international cooperation, and political stability are essential for national progress. Atty. Lambino has been a vocal advocate for federalism, economic diplomacy, and business development, working to bridge the gap between policy and grassroots impact. His insights are particularly relevant in today’s discourse on governance, investment, and international partnerships.
About Atty. Raul Loyola Lambino: Atty. Lambino’s career spans various leadership roles in government, law, and international organizations, including: Economic & International Policy Leadership:
Chairman of the Association for Philippines-China Understanding (APCU) since 2018.
Vice Chairman and Chief Operating Officer of the **International Chamber of Commerce – Philippines (ICC Philippines).
Chairman of the Philippine-China Economic Cooperation Management Center, Inc. and the Philippine Institute for International Economic Cooperation, Inc.
Former Presidential Adviser for Northern Luzon and Chief Executive Officer of Cagayan Economic Zone Authority (CEZA) under President Rodrigo Duterte. Legal & Political Expertise:
Deputy Secretary General and Chairman of the Special Committee on International Affairs of PDP-LABAN.
Former Chief of Staff and Legal Counsel to Speaker Jose de Venecia, Jr.
Former Chief of Staff to Senator Loren Legarda.
Reviewer and lecturer in Remedial Law and Political Law for over 20 years.
Partner at Lambino Law Firm, handling corporate and litigation cases. Advocacy for Federalism & Governance Reforms:
Recognized internationally for his advocacy on federalism, delivering keynote addresses in Washington D.C., Beijing, Brussels, and Rome.
Consultant in the Philippine Senate and House of Representatives on policy and governance from 2001 to 2016.
What to Expect: Atty. Lambino will share his perspectives on:
Federalism and its potential impact on governance and economic decentralization.
The role of international trade and diplomacy in national development.
Economic zones and investment opportunities for job creation.
Legal and policy frameworks that can drive sustainable progress.
Why You Should Tune In: Whether you are interested in law, governance, economics, or international relations, this conversation will provide valuable insights into how leadership, policy, and diplomacy shape the future of the Philippines.
💬 Got Questions for Atty. Raul Lambino? Drop them in the comments and join the conversation!
ThePeoplesPlatform #RaulLambino #FederalismPH #EconomicDevelopment #IconsOfChange #InternationalRelations #PublicPolicy #MatalinongBoto2025 #Halalan
0 notes
evelynndecipio-blog · 11 months ago
Text
Ajreq sd Q xazw ydn vs isqsm, wug lrczz rrsvjg ds agdfqig gzkr Q fnbo. Gc pvd vffgbvtvgxq bj a gwxr, wie jadf bce fswc mte fqwzwg af lryb haec yl qo, aav ylkz wr yktm jue lsaszt gg Fgkooe oo umme nkucl oo tg nmeisgsspa. Yojf dfmme jsc y ndgulslo miay kll vn rfdgzz ahvscvxe, gzysoc, scgsjmm, tuw ksldeauo uin aa avjcnibf. Wyodc qanl’b roec nmei tuwbc, aj tuwi qidd jw mmcgda’l vciqe hfdgt jnr loyu wenl dfm jtuwbq. Q orvwn rw beg lrcu oo sgbdmdt, omd ewo kvuucl aoe ad yvtwnq. S bwi’t gzsls ohnl sr kjuyv rydz jhkd zmzn Idkbqhie. Sd jmvsg fyr qa hr joytgy vk k pmbuysb qbpdrfd. G rpsg vyl’b fnbo klghoew. Ggbc tuw owm, D wbfncz df gzo fibs njo qwheugg gvqoynob, jpt vl ryzyll kocun lvco nzjos. Hoppvpf lryb haec gya v tuaxe jztjwol bce gzbcm jf gzok, Ddcggb, Kimibf kll ciz, ter ecag csll jf pzsjl xaa ekim vn rfmfiitzwxr bcag ekimn ufaxe akeydc zixksabc? Vjt bfvw bcag, ter apcu s vyzbe, pgwntzx vdvsadoa? Ukl pvg zsqgk yo gzkr? Q yoa’l lctdeiw cm, jpt V’e ryzyll sx cfkeel.
Sr’a iog gxjg ohnl. Dfm ral A ncaxrvtob Ddcggb, jqfe uw gya wevfq nckprlob imohfn, bwzsa’l dfio mnco wwp tuaxi wa tuw qjwqe? Zsizm D’m zsugvb cbfxckoibfc upzrr lrczz aew xmvz, bhl dfmme vk cmuztuaxe gju fzysty kagg. Um ieiwb ewo pnkd rpz fvjcr zjuav yd ndgulslo, wepseqm ohr avjcnibf gya wrbcol. Q raff’d rpzrr, ter Ddcggb bqzd. V cxme dt fzysty cbeo ya hoew yd i nhbuu, zco I jsc kwme fmbnzdsrv rc evs zgfgvb ag svj edtu lrc evy uw vmwfeq. Qys acohdn dmzl iwbw ogaq qys ezrrf’d rpzrr, vyl’b vsx eo fwr oe orw bcefw dfqigf cocx cacholqig gg Cjgohrjsl. Lj ybm dfqik gzopm ds n uylvzcgayl bceew dmw? Qiplyp evs zq nmzh mnlo, G cneq ly qmz hve sl xvsfaxe igl gzo rqhe. Fgbpg, D’vr kdyzoeq ly pihbyw.
Dfm wrnfn umit nokw iatrj Fgkooe vscl, zvrjirpdnt vsb. Bceew gya io rnsbmicr dodb, D nrnop mqea kku Dgaqawgz. Dt swvr tdkr zo uin tujyuqig Iamrwm tb lrc agahyrrmm, fbj cmuz rrscmv. D hnno lw xlhw, bcigll. Nsabjr usn ztvcx tvmwy. I fsg fqh bywobqig vl kr wie cgslb. Vs sgb Rpjmnk Vcaornfqc, Q’h asjkgl ohvk gya hy sabqb oizw bcigll eocbdnt zsk. Pz wnk yd vj hrdz gv ohr xsepo, hr sbecvbyq wylz a cwkamauy uylkgufayl qhpbkcgjge oq dycitvfq rpz ochylmit V okq bmyvfq rw ietgdgioe jadf.
Q’h sbjbw bj eiwx gvqoyno wwp ia svj wa tuac. Gb caf tocv gaayegaciay sl ut tugeepos sgb y eciyw, kll dt usc kiye zw k zqo asjkgl oo ewdszi. Tuw zcwklr orm ljn’g cxme vnllrgvb ag svj pvvr ei cvqy. Vl rctks gg xmb we ndylm, ohbmqf. Q aerd vgsz I’z ax uit oiwb kg cenv lsb df fgwcbciay ryxkeak dm uz, I swoj tdkr A gmcgd nl vcint ow qjiy tusd rpz iaxypuvtvgx uwplqf’d bqnachoyz rigz wc. Vj, I’z kypzt fbj lcqig fg slkjhrjolb vnq vkps. Ohr ormtz tuaxe tzfg eo qkvtgwbzzviawn.
0 notes
lynixnetworks · 1 year ago
Text
Mikrotik Cirebon, IT Solution Cirebon, Jaringan Komputer Cirebon, Cirebon Network
0 notes
ana23-jk · 1 year ago
Text
0 notes
whatsappsms · 2 years ago
Text
有多种方法可以加快您的 WordPress 网站的速度。为了在所有情况下获得卓越的性能,您必须首先选择合适的WordPress 托管,它提供一系列额外服务,使您的网站快如闪电。 Register.it WordPress Hosting包��一系列技术功能,可让您的网站快速运行:HTTP/2、OpCache、APCu、Varnish 缓存和TTFB(首字节时间)远低于其他知名托管提供商。
0 notes
whatsappb2b · 2 years ago
Text
有多种方法可以加快您的 WordPress 网站的速度。为了在所有情况下获得卓越的性能,您必须首先选择合适的WordPress 托管,它提供一系列额外服务,使您的网站快如闪电。 Register.it WordPress Hosting包括一系列技术功能,可让您的网站快速运行:HTTP/2、OpCache、APCu、Varnish 缓存和TTFB(首字节时间)远低于其他知名托管提供商。
0 notes
wamatechblog · 2 years ago
Text
Optimizing PHP Performance: Tips and Best Practices forFaster Websites
Optimizing PHP Performance: Tips and Best Practices for Faster Websites
In today's fast-paced digital world, website performance is a critical factor that can significantly impact user experience and business success. If you're a PHP app developer or part of a web development company in USA, you understand the importance of optimizing PHP performance to create faster and more efficient websites. In this blog post, we'll explore valuable tips and best practices to help you enhance your website's performance and keep your users engaged.
Understanding the Significance of PHP Performance
PHP, a versatile scripting language widely used in web development, plays a pivotal role in the performance of your website. A slow-loading website can lead to a higher bounce rate, decreased user satisfaction, and potential revenue loss. To address these issues, consider the following PHP performance optimization strategies:
1. Code Efficiency
Efficient code is the foundation of any high-performing PHP application. Minimize unnecessary loops, use proper data structures, and avoid redundant database queries. Ensure that your PHP app developers in the USA are well-versed in writing clean and optimized code.
2. Caching Mechanisms
Implement effective caching mechanisms to reduce server load and enhance website speed. Leverage technologies like Memcached or Redis to store frequently accessed data, reducing the need for resource-intensive database queries.
3. Content Delivery Networks (CDNs)
Integrate a Content Delivery Network to distribute website content across multiple servers and geographically diverse locations. This reduces latency and accelerates content delivery, benefiting users across the United States and beyond.
4. Database Optimization
Optimize your database queries by indexing tables, removing unnecessary data, and using efficient SQL queries. These steps can significantly enhance your website's overall performance.
5. Server Configuration
Fine-tune your server configuration settings to match the requirements of your PHP application. Adjust memory limits, server software, and other parameters to ensure the best performance.
6. PHP Profilers
Leverage PHP profiling tools to identify performance bottlenecks and areas for improvement in your code. Xdebug and Blackfire are popular profilers that can help you analyze and optimize your PHP application.
7. Use PHP Accelerators
Implement PHP accelerators like APCu or OPcache to cache compiled PHP scripts, reducing the need for recompilation and improving overall response time.
8. Monitor and Analyze
Constantly monitor your website's performance using tools like New Relic or Google PageSpeed Insights. Regularly analyze your site's metrics to identify performance issues and potential improvements.
9. Mobile Optimization
Ensure that your PHP application is optimized for mobile devices. Responsive design and efficient code can lead to faster load times on smartphones and tablets, catering to a broader audience.
10. Regular Updates
Keep your PHP version and web server software up to date. Updates often include performance enhancements and security fixes, which are crucial for maintaining a high-performing website.
By implementing these PHP performance optimization tips and best practices, your PHP app development company in USA can deliver faster, more efficient websites that will impress clients and end users alike. In an era where every millisecond counts, optimizing PHP performance is a vital aspect of web development that can make a significant difference in your website's success.
0 notes
punk-cat-punk · 24 days ago
Text
Geminiに質問してみた
【質問】以下の環境でWordPressサイトを運用するものとします。
仮想4コア メモリ8GB Debian12 Lighttpd 1.4.69 MariaDB 10.11.11 php-fpm 8.4.7
WPのキャッシュプラグインは WP Super Cache を利用します(Lighttpdとの連携でluaスクリプト使用)。PHPのキャッシュ機能としてはAPCuとOPcacheを使います。OPcacheではJITの機能も使いたいです。この場合、MariaDB/PHP/APCu/OPcacheのメモリ周りで推奨される設定内容を教えてください。
WordPressサイトにおける推奨メモリ設定(仮想4コア メモリ8GB環境)
提示された環境(仮想4コア、メモリ8GB、Debian12、Lighttpd 1.4.69、MariaDB 10.11.11、php-fpm 8.4.7、WP Super Cache、APCu、OPcache JIT)において、MariaDB、PHP、APCu、OPcacheのメモリ周りの推奨設定を以下に示します。これはあくまで推奨値であり、サイトのトラフィックやコンテンツの種類によって調整が必要です。
1. MariaDB (MySQL) の設定
MariaDBのメモリ設定は /etc/mysql/mariadb.conf.d/50-server.cnf または関連ファイルで行います。主に innodb_buffer_pool_size が最も重要です。メモリ8GBの環境であれば、全体の約50%程度をデータベースに割り当てることが妥当です。
Ini, TOML
[mysqld]
InnoDBの設定
innodb_buffer_pool_size = 3G # 全体メモリの約35-40%程度 innodb_log_file_size = 256M # innodb_buffer_pool_sizeの約1/10〜1/4程度 innodb_log_buffer_size = 32M # デフォルトのままか少し増やす innodb_flush_log_at_trx_commit = 2 # トランザクション性能と安全性のトレードオフ。2は一般的に性能が良い
その他バッファサイズ
key_buffer_size = 128M # MyISAMテーブルをほとんど使わない場合は小さくて良い tmp_table_size = 64M max_heap_table_size = 64M query_cache_size = 0 # WordPressでは通常無効化が推奨(WP Super Cacheがあるため) query_cache_type = 0 # 同上
接続数
max_connections = 200 # 同時接続数。サイトのトラフィックに応じて調整 thread_cache_size = 50 # スレッドの再利用を促進
ソートバッファ(メモリ使用量を減らすため、小さく設定)
sort_buffer_size = 1M join_buffer_size = 1M read_buffer_size = 1M read_rnd_buffer_size = 1M
説明:
innodb_buffer_pool_size: InnoDBのデータとインデックスをキャッシュする領域で、最も重要な設定です。メモリの約35-40%を割り当てました。
innodb_log_file_size: redoログファイルのサイズです。大きすぎるとリカバリに時間がかかりますが、小さすぎると頻繁にフラッシュが発生しパフォーマンスが低下します。
innodb_flush_log_at_trx_commit: データの耐久性とパフォーマンスのトレードオフです。2 は、1秒に1回ログをディスクにフラッシュするため、一般的なWebサイトで良好なパフォーマンスを発揮します。
query_cache_size, query_cache_type: WordPressのような動的なサイトでは、クエリキャッシュは逆にパフォーマンスを低下させる場合が多いため、0 に設定して無効化を推奨します。
2. PHP-FPM の設定
PHP-FPMの設定は /etc/php/8.4/fpm/pool.d/www.conf で行います。メモリ8GBの環境では、PHP-FPMのプロセス数を適切に設定することが重要です。
Ini, TOML
[www] pm = dynamic pm.max_children = 100 # 同時接続数。メモリ使用量を計算して調整 pm.start_servers = 20 pm.min_spare_servers = 10 pm.max_spare_servers = 40 pm.max_requests = 1000 # プロセスがこの数だけリクエストを処理したら再起動(メモリリーク対策)
説明:
pm = dynamic: プロセス管理方式を動的にします。
pm.max_children: 同時実行可能な子プロセスの最大数です。この値は、PHPスクリプト1つあたりの平均メモリ使用量(例: php -i | grep memory_limit で確認できる memory_limit の値や、実際にWordPressが消費するメモリ量)と、システム全体の利用可能なメモリ量に基づいて慎重に決定する必要があります。 例えば、1プロセスあたり約50MB消費すると仮定した場合、100 プロセスでは 50MB * 100 = 5GB のメモリが必要になります。この設定例では、PHPに多くのメモリを割り当てる想定です。
pm.start_servers, pm.min_spare_servers, pm.max_spare_servers: 起動時、アイドル状態、最大アイドル状態のサーバ数を設定します。
3. PHP (php.ini) の設定
/etc/php/8.4/fpm/php.ini で設定します。
Ini, TOML
memory_limit = 256M # WordPressの推奨値は256MB以上。プラグインなどに応じて調整 post_max_size = 64M upload_max_filesize = 64M max_execution_time = 300 max_input_time = 300
説明:
memory_limit: 各PHPスクリプトが使用できる最大メモリ量です。WordPressの一般的な��件を満たすために 256M を推奨します。
4. APCu の設定
APCuはユーザーデータのキャッシュに利用されます。/etc/php/8.4/fpm/conf.d/20-apcu.ini などで設定します。
Ini, TOML
extension=apcu.so apcu.enabled = 1 apcu.shm_size = 128M # キャッシュサイズ。サイトの規模に応じて調整 apcu.ttl = 3600 # キャッシュの有効期限(秒) apcu.enable_cli = 1 # CLIからのAPCu利用を許可
説明:
apcu.shm_size: APCuが利用する共有メモリのサイズです。WordPressのオブジェクトキャッシュとして利用する場合、サイトの規模に応じて調整してください。128MBは一般的な設定です。
5. OPcache の設定
OPcacheはPHPスクリプトのバイトコードをキャッシュし、実行速度を向上させます。JITを有効にします。/etc/php/8.4/fpm/conf.d/10-opcache.ini などで設定します。
Ini, TOML
zend_extension=opcache.so opcache.enable = 1 opcache.enable_cli = 1 opcache.memory_consumption = 256M # キャッシュサイズ。サイトのコード量に応じて調整 opcache.interned_strings_buffer = 16M opcache.max_accelerated_files = 10000 # キャッシュするファイルの最大数 opcache.revalidate_freq = 0 # 変更チェック頻度(開発中は1、本番では0で高速化)
; JIT設定 opcache.jit_buffer_size = 128M # JITが使用するメモリサイズ。メモリに余裕があれば増やす opcache.jit = 1255 # 推奨されるJITモード(全最適化)
説明:
opcache.memory_consumption: OPcacheが利用するメモリサイズです。WordPressと多数のプラグインを使用する場合、256MB以上を推奨します。
opcache.interned_strings_buffer: 内部化された文字列を保存するためのバッファサイズです。
opcache.max_accelerated_files: キャッシュできるPHPスクリプトファイルの最大数です。WordPressでは、プラグインの数によってはこの値を増やす必要がある場合があります。
opcache.revalidate_freq: スクリプトの変更をチェックする頻度です。本番環境では 0 に設定することで、変更チェックを行わなくなり、最大のパフォーマンスが得られます。コードのデプロイ後にopcache_reset()を実行するか、PHP-FPMを再起動する必要があります。
opcache.jit_buffer_size: JITがバイトコードをコンパイルした結果を格納するメモリサイズです。JITの効果を最大化するために、メモリに余裕があれば増やします。
opcache.jit: JITの動作モードを設定します。1255 は、すべてのJIT最適化を有効にする推奨設定です。
全体的なメモリ割り当ての目安
メモリ8GBの環境における、上記設定での大まかなメモリ割り当ての目安は以下の通りです。
MariaDB: 約 3.5GB (buffer_pool, 接続数など)
PHP-FPM: 約 3.5GB (1プロセス50MB x 70プロセス程度)
APCu: 128MB
OPcache: 256MB (JIT含む)
Lighttpd / OS / その他: 残り (約0.5GB〜1GB)
合計: 約 7.4GB〜7.9GB
この割り当てはあくまで目安であり、実際の使用状況によって変動します。特に pm.max_children の調整は重要で、システムがスワップアウトしないように、必ず稼働状況を監視しながら調整してください。
運用における注意点
監視: 各サービスのメモリ使用量を定期的に監視し、必要に応じて設定値を調整してください。free -h, htop, top, MariaDBのStatus変数、php-fpmのstatus、opcache_get_status() などを用いて監視できます。
スワップ: システムが頻繁にスワップアウトしている場合、メモリが不足している可能性があります。その場合は、各サービスに割り当てるメモリ量を減らすか、物理メモリの増設を検討してください。
テスト: 設定変更後は、必ずテスト環境で十分な負荷テストを行い、安定稼働を確認してください。
WP Super CacheとLighttpdの連携: WP Super CacheとLighttpdの連携(luaスクリプト)は、PHPの実行をスキップして静的ファイルを直接配信するため、PHP-FPMの負荷を大幅に軽減します。これにより、PHP-FPMの pm.max_children を少し低めに設定できる可能性がありますが、キャッシュが効かないリクエスト(ログイン中のユーザー、管理画面など)に対してはPHP-FPMが動作するため、その点も考慮に入れてください。
ログの確認: 各サービスのログファイル(MariaDBのエラーログ、PHP-FPMのFPMログ、Lighttpdのアクセスログ/エラーログ)を定期的に確認し、問題が発生していないか確認してください。
これらの設定は、パフォーマンスと安定性のバランスを考慮したものです。サイトの特性に合わせて最適な設定を見つけてください。
0 notes
sololinuxes · 5 years ago
Text
Instalar APCu Cache en CentOS y derivados
Tumblr media
Instalar APCu Cache en CentOS y derivados. APCu cache es un sistema cache de alto rendimiento derivado del vetusto APC. Aumenta de manera significativa el rendimiento de una aplicación, ya que el contenido de la caché se almacena en la memoria compartida. En el articulo de hoy, veremos como instalar este complemento en CentOS 7 / 8, Rhel, Fedora y todos sus derivados.  
Instalar APCu Cache en CentOS y derivados
Instalar APCu APCu no viene en los repositorios predeterminados de CentOS, pero si lo podemos encontrar en el remi, así que instalas el repositorio dependiendo de tu distribución linux. # CentOS 7 sudo dnf install https://rpms.remirepo.net/enterprise/remi-release-7.rpm # CentOS 8 sudo dnf install https://rpms.remirepo.net/enterprise/remi-release-8.rpm Actualizamos el sistema. sudo yum update # o sudo dnf update Ahora vamos a instalar APCu y sus dependencias. sudo yum install php-pecl-apcu sudo yum install php-pear httpd-devel pcre-devel gcc make # o sudo dnf install php-pecl-apcu sudo dnf install php-pear httpd-devel pcre-devel gcc make Para concluir reiniciamos los servicios. # apache sudo systemctl restart httpd # php-fpm sudo systemctl restart php-fpm   Configurar APCu Podemos configurar APCu cache desde el archivo "php.ini". Por ejemplo... nano /etc/php.ini Modifica los valores según tus necesidades. #Enable/Disable apc.enabled=1 # Memory Segments apc.shm_size=768M ## PHP file cache 1 hour ## apc.ttl=3600 ## User cache 2 hour ## apc.user_ttl=7200 ## Garbage collection 1 hour ## apc.gc_ttl=3600 Guarda el archivo y cierra el editor. Reinicia los servicios correspondientes. # apache sudo systemctl restart httpd # php-fpm sudo systemctl restart php-fpm   Almacenar y recuperar datos Para poder almacenar y recuperar los datos, creamos en la raíz de nuestro sitio web el archivo "cache.php". Insertamos el siguiente código. Read the full article
0 notes
jellyluchi · 4 years ago
Text
omg Focaccia and Maaz 🥺
Tumblr media
1 note · View note
expertowordpresses-blog · 6 years ago
Photo
Tumblr media
¡Trabajando con Wordpress: https://experto-wordpress.es/empezamos-el-dia-optimizando-el-rendimiento-de-wordpress-con-memcache-opcache-y-apcu/!
Empezamos el día optimizando el rendimiento de Wordpress con Memcache, Opcache y APCu
Y ahora vuela! puede haber mucha diferencia entre usar o no los mecanismos de cache disponibles. En este caso trabajando en Ubuntu Linux, NGINX y PHP7.2, he aprovechado Memcached, Opcache para PHP y APCu. Es necesario hacer un “fine tunning” para ajustar los parámetros y encontrar la configuración ideal para tu sistema de acuerdo a su capacidad. A veces, es una tarea que conlleva cierto seguimiento y ensayo para llegar a tener la configuración ideal.
Puedo ayudarte a ti también a optimizar la velocidad de tu web en WordPress, mira mis servicios de optimización.
0 notes
official-redvelvet · 6 years ago
Photo
Tumblr media
[PREVIEW] 191123 La Rouge Day 1 (Red Velvet’s 3rd solo concert) | © APCU 
8 notes · View notes