[PHP] How to preload opcache dirs ?
- Date: Thu, 1 Feb 2018 22:47:39 -0700
- From: Gary M <garym@xxxxxxxxxx>
- Subject: [PHP] How to preload opcache dirs ?
I'm trying to use my php app and php7 in AWS lambda. Lambda doesn't
natively support php, so I need to proxy through nodejs.
A problem with lambda is the more application files accessed from disk
increases request response time. Once a cold start is completed, php7 can
be very fast. eg. 0.066ms. Lambda periodically recycles instances, meaning
once php byte code is in opcache, the instance may be discarded forcing
cold start compiles on the next request. Memcached cannot be used in the
I'd like to find a way to precompile my php code and place the byte code
into opcache's directory.
I'm not sure how to make this work. Suggestions appreciated