Welcome! Log In Create A New Profile

Advanced

Re: nginx for Windows - WSASend() socket error 10057

Maxim Dounin
February 28, 2020 08:28AM
Hello!

On Thu, Feb 27, 2020 at 07:40:38PM +0000, Yury Shpakov wrote:

> I wrote my own auth_http server. And it was hit only one time for 1000 SMTP requests.
> So auth_http is requested once per session/connection.

There is no such thing as "SMTP requests". And yes, that's
expected that's auth_http is called once per connection: auth_http
is only called for authentication, non for each SMTP command.

> For this example it's hit once:
>
> using (var smtpClient = new SmtpClient("localhost", 8025) { Timeout = 60 * 60 * 1000 })
> {
> for (int i = 0; i < 1000; i++)
> {
> smtpClient.Send("noreply@wmata.com", "ys@wmata.com", "Email subject", "Email body");
> }
> }
>
>
> For this example it's hit 1000 times:
>
> for (int i = 0; i < 1000; i++)
> {
> using (var smtpClient = new SmtpClient("localhost", 8025) { Timeout = 60 * 60 * 1000 })
> {
> smtpClient.Send("noreply@wmata.com", "ys@wmata.com", "Email subject", "Email body");
> }
> }

The difference is that in the first example you establish one
connection and use it to send 1000 messages, while in the second
example you establish 1000 connections - and each of them calls
auth_http.

> Evidently by the same reason this one didn't work either:
> smtp_greeting_delay 10s;

This directive delays SMTP greeting. It is expected to happen
only once per connection, see here for an overview of the SMTP
protocol:

https://tools.ietf.org/html/rfc5321

> This options is not gonna work either:
> - Maxim's ngx_http_delay (I used it more for development purposes, like test or simulation of load etc);

That's expected as well, as the delay module is to delay HTTP
requsets, not SMTP commands.

> If I do this I don't need nginx at all. But my boss said: "Use nginx. Period.":
> - some "slow" upstream backend that doing nothing, just waiting (preferably asynchronous).
>
> So the question is still open: how to make nginx wait on SMTP
> processing to model latency for my load tests?

If you are trying to model latency within a single SMTP
connection, the answer is: you can't do this with nginx, as nginx
does not try to do anything with an established and authenticated
connection SMTP connnection, and doesn't even try to parse what
happens on such a connection. It merely proxies bytes between the
client and the backend server.

Either way, this thread looks like an off-topic for the
nginx-devel@ mailing list.

--
Maxim Dounin
http://mdounin.ru/
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

nginx for Windows - WSASend() socket error 10057

Yury Shpakov 1351 February 11, 2020 09:04PM

Re: nginx for Windows - WSASend() socket error 10057

Sergey Brester 316 February 12, 2020 07:40AM

Re: nginx for Windows - WSASend() socket error 10057

Yury Shpakov 173 February 12, 2020 01:00PM

Re: nginx for Windows - WSASend() socket error 10057

Sergey Brester 215 February 12, 2020 01:52PM

Re: nginx for Windows - WSASend() socket error 10057

Yury Shpakov 163 February 13, 2020 04:46PM

Re: nginx for Windows - WSASend() socket error 10057

Yury Shpakov 193 February 13, 2020 04:50PM

Re: nginx for Windows - WSASend() socket error 10057

Sergey Brester 202 February 14, 2020 06:00AM

Re: nginx for Windows - WSASend() socket error 10057

Yury Shpakov 472 February 14, 2020 06:10PM

Re: nginx for Windows - WSASend() socket error 10057

Yury Shpakov 158 February 25, 2020 08:00PM

Re: nginx for Windows - WSASend() socket error 10057

Sergey Brester 152 February 26, 2020 04:52AM

Re: nginx for Windows - WSASend() socket error 10057 Attachments

Yury Shpakov 137 February 26, 2020 03:38PM

Re: nginx for Windows - WSASend() socket error 10057 Attachments

Sergey Brester 170 February 27, 2020 05:22AM

Re: nginx for Windows - WSASend() socket error 10057

Maxim Dounin 142 February 27, 2020 06:48AM

Re: nginx for Windows - WSASend() socket error 10057

Dipl. Ing. Sergey Brester 192 February 27, 2020 08:30AM

Re: nginx for Windows - WSASend() socket error 10057 Attachments

Yury Shpakov 142 February 27, 2020 02:42PM

Re: nginx for Windows - WSASend() socket error 10057

Maxim Dounin 396 February 28, 2020 08:28AM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 294
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready