-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using Warmup requests and Warmup docs #5312
Comments
Hi @simoncast, The article still contains the best distillation of how to get it set up. Can you post the version of HHVM that you're using, along with all of the configuration files that you are passing to the server? |
Hi @jazzdan Thanks for replying. We tried two different ways of doing it. 1st scenario: 2nd scenario: https://gist.github.com/simoncast/f5dcf3b989057cdee660 for the file. Neither approaches called the file in question. From the etsy article they specify this method of calling
But that looks like the old HDF config files. How do we specify the same thing in the ini files? If we need to use the HDF file, do we just create the file and put it in the config directory or do we have to include it in the ini file or something? |
Hey @simoncast, Sorry about the late reply. While many of the HDF configuration options have been ported to INI configuration options, some of the more obscure ones still have not. In order to use warmup requests you need to put the configuration options in HDF files, not INI files. |
@jazzdan ok we'lld try the HDF file approach. Do we have to name the file anything specific or just create a config.hdf file in the directory with the ini files? |
Hi @jazzdan we've created the HDF files but we can't seem to get the PHP file to be called during restart. Is there a specific setting in php.ini/server.ini needed? We are using 3.7.0 |
Hi @simoncast, Let me describe exactly how we have this set up, hopefully we can identify where we're missing something in your configuration. We have an We also have a
This file contains references to other hdf documents that we use to warmup HHVM. Let's take a look at one of these files:
This tells HHVM to execute Does this square with what you're doing? |
Hi Dan, As a bit of background: we are using Symfony 2 as the basis of a API backend for various client based frontend (primarily at this point AngularJS). So after a bit of playing around yesterday I've got the warmup.php file being called. However, it doesn't seem to be interacting with HHVM that is producing any JIT compilation. Our warmup.php file is essentially trying to call the API endpoints using CURL (e.g. 127.0.0.1/[some url]). The output of CURL is connection refused at 127.0.0.1 on what ever port I've tried. My hypothesis is that is because HHVM is not actually listening on any port during the warmup phase. Is that correct? Does it make more sense to call the frontend controller in this case? |
@simoncast that's correct, HHVM isn't accepting any connections on ports until the warmup document is completed. Instead of having a script that curls HHVM, you should just have a script that executes some important, often-called code in your application directly. I've never used symfony, but I imagine maybe instantiate a couple ORM models and controllers? For example, our "warmup script" ( #!/usr/bin/php
<?php
require_once 'bootstrap.php;
$response = null;
$search_suggestion_input = new Api_Input();
$search_suggestion_input->loadInput(['query' => 'warmup']);
$get_listings_input = new Api_Input();
$get_listings_input->loadInput(['listing_id' => 150008123]);
Search_Suggestion::handle($search_suggestion_input, $response);
Listings_GetListingCards::handle($get_listings_input, $response); This is because Search Suggestions and Listing Card are two of our most hit API endpoints, so we want to warmup with those and ensure that they are JIT'd. |
Hey @simoncast, did this resolve your issue? |
@jazzdan yes I think I've got it working now. Out of curiosity how many times do you normally call the warmup requests? 12 or 24? Are there any settings in php.ini we should set to make sure the JIT is run enough times? |
Hey @simoncast, We just call them 12 times, and we haven't made any changes relating to the JIT in our INI files. |
@jazzdan I am not a php developer, but I am trying to implement this warmup feature for the WordPress sites I serve via HHVM. What might my warmup.php look like if I only want to prime generic WordPress pages rather than API calls? (i.e. the site's homepage and a handful of other top-hit pages) Thanks! |
Hi @collinbarrett, I'm not familiar with wordpress, sorry! You could just make it your WordPress installation's index.php though I imagine. |
Look at your access logs, and try to make your warmup.php imitate the most popular requests that you're actually getting. |
@jazzdan and @fredemmott , thanks. I haven't had a chance to try it yet, but I'll let you know. |
We are trying to use the warmup requests capability of HHVM as detailed in this <a href=https://codeascraft.com/2015/04/06/experimenting-with-hhvm-at-etsy/">article by Etsy and mentioned on the HHVM wiki in passing.
We've tried using both HDF and ini files but neither is calling the warmup doc when HHMV is restarted. How do you go about using the HHVM warmup requests & docs?
The text was updated successfully, but these errors were encountered: