# Any caveat in using post\_action?

**URL:** <https://www.ruby-forum.com/t/any-caveat-in-using-post-action/224281>\
**Category:** NGINX\
**Created:** [November 6, 2012, 2:43pm UTC](https://www.ruby-forum.com/t/any-caveat-in-using-post-action/224281 "2012-11-06T14:43:01Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![aris](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/258eb7/32.png) [@aris](https://www.ruby-forum.com/u/aris)\
**Post date:** [November 6, 2012, 2:43pm UTC](https://www.ruby-forum.com/t/any-caveat-in-using-post-action/224281/1 "2012-11-06T14:43:01Z")

</div>

Hi,

I am going to use post\_action for mirroring the load for performance  
testing to new backend.

But according to the doc:

> > Note: this directive “has subtleties” according to Maxim D., so use  
> > at your own risk.

Some questions:

1. Is the post\_action blocking to the user request? Or the sub request  
is  
truly async and not affecting to the user?
2. And caveat is using high load env, e.g. stability?

So anyone mind share your experience?

Thanks.

---

<div class="post-metadata">

**Author:** ![howard\_chen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/bbce88/32.png) [@howard\_chen](https://www.ruby-forum.com/u/howard_chen)\
**Post date:** [November 6, 2012, 3:43pm UTC](https://www.ruby-forum.com/t/any-caveat-in-using-post-action/224281/2 "2012-11-06T15:43:47Z")

</div>

Hello!

On Tue, Nov 06, 2012 at 09:42:22PM +0800, howard chen wrote:

> Hi,
> 
> I am going to use post\_action for mirroring the load for performance  
> testing to new backend.
> 
> But according to the doc:
> 
> > > Note: this directive “has subtleties” according to Maxim D., so use  
> > > at your own risk.

There is no official documentation on the “post\_action” directive  
(you may check yourself at [nginx documentation](http://nginx.org/en/docs/)), and it’s on  
purpose. What you are quoting is wiki.

> Some questions:
> 
> 1. Is the post\_action blocking to the user request? Or the sub request is  
> truly async and not affecting to the user?

The post\_action is executed in the context of the main request,  
and will block further work on the same client connection till  
it’s complete.

That is, it’s unlikely a good idea to use post\_action for  
performance testing. I would recommend logging requests instead  
and re-executing them with a separate process.

[…]

–  
Maxim D.

> **[F5 NGINX: Built for cloud-native apps. Ready for AI traffic.](https://www.f5.com/products/nginx)**
>
> Deliver modern applications with NGINX. Explore high-performance load balancing, API gateways, and web server solutions trusted by top global enterprises.
