Multiple IP's for one varnish purger

Created on 16 January 2017, almost 8 years ago
Updated 2 September 2024, 4 months ago

When scaling up, its necessary to have more than one varnish server, due to the way the config is tied to site config, it makes this very messy, requesting multi hosts for one purger

✨ Feature request
Status

Needs review

Version

2.0

Component

Code

Created by

πŸ‡¬πŸ‡§United Kingdom zach.bimson

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • First commit to issue fork.
  • πŸ‡«πŸ‡·France goz

    This is still the case for 8.x-2.x, but patch does not apply

  • @goz opened merge request.
  • πŸ‡«πŸ‡·France goz

    Merge request use #14, but re-roll for 2.x

  • πŸ‡«πŸ‡·France izus

    Patch #21 worked for me against 8.x-2.2.

    Thanks

  • πŸ‡¬πŸ‡§United Kingdom zach.bimson

    Love the power of the community! 6 years we are in :D

  • πŸ‡ΈπŸ‡ͺSweden MiSc

    Could someone please review this?

  • πŸ‡ΊπŸ‡ΈUnited States jerrac

    Just ran into a need for this again. But #21 won't apply.

    Could not apply patch! Skipping. The error was: Cannot apply patch https://git.drupalcode.org/project/varnish_purge/-/merge_requests/11.patch
    In Patches.php line 331:
                                                                                   
      Cannot apply patch Multiple Varnish Server IPs (https://git.drupalcode.org/p  
      roject/varnish_purge/-/merge_requests/11.patch)!
    

    This is with explicitly setting varnish_purge to version ^2.x-dev in composer.json and using cweagans/composer-patches to apply the patch.

    I initially tried with 2.1 and 2.2, not dev.

    I also pulled up the patch dialog in PHPStorm and it said it can't apply a hunk.

    Don't have time right now to dig in deeper. Hope this helps.

  • πŸ‡«πŸ‡·France just_like_good_vibes PARIS

    if you use the patch derived from the MR 11 of @goz β†’ , it should be fine.

    use this URL for the patch :

    https://git.drupalcode.org/project/varnish_purge/-/merge_requests/11.patch

    I have started testing this patch on the last version 2.2 and it seems to works fine.

  • πŸ‡ΊπŸ‡ΈUnited States jerrac

    Er, I'm 99% sure that's the url I used when I was trying to patch.

    That said, long story, but I ended up switching to the http purger built into Purge and was able to make it work. Just added a purger per instance of varnish.

  • For me, using https://git.drupalcode.org/project/varnish_purge/-/merge_requests/11.patch introduces a bug.
    It fails to correctly send ban requests, queue is not decreasing, varnish cache is never cleared. I have the following error in the cron logs :

    Drupal\purge\Plugin\Purge\Purger\Exception\BadPluginBehaviorException : Only NOT_SUPPORTED, PROCESSING, SUCCEEDED and FAILED are valid outbound states. dans Drupal\purge\Plugin\Purge\Invalidation\InvalidationBase->setStateContext() (ligne 144 de /var/www/ppd/xxxxxxxxx/web/modules/contrib/purge/src/Plugin/Purge/Invalidation/InvalidationBase.php).

    And I don't even have 2 hosts in my purger config.

  • πŸ‡«πŸ‡·France O'Briat Nantes

    If your Varnish servers are load balanced, it should easier to add a specific rules to your load balancer (filtered on drupal IP + PURGE/BAN method) so it send the request to both all Varnish instances.

    So you just need to set the inbound LB IP.

Production build 0.71.5 2024