Will the maximum limit of the MaxReceivedMessageSize configuration property in wcf affect the performance of the service?

I get the following shutdown message for my wcf service making cal for another wcf service: "The maximum message size quota for incoming messages (65536) has been exceeded. To increase the quota, use the MaxReceivedMessageSize property in the corresponding binding element."

I solved this by increasing the size as shown below: maxReceivedMessageSize = "50000000"

But here I want to know if there will be any side effects of increasing the message size to such a large level.

+6
wcf
source share
2 answers

Yes - it is possible. The reason WCF supports this minimum (64KB) by default is as follows: Imagine that your server is busy answering requests, for example, in tens or hundreds, and all of them require a maximum message size.

Potentially, your server may need to simultaneously allocate tens or hundreds of message buffers - if you have 100 users and each request is 64K, then this is 6.4 MByte, but if you have 200 users and each of them requests 5 MB, gigabytes of RAM on the server - only for message buffers for one service.

So, yes, limiting the limit on the maximum message size makes sense, and it helps to manage server memory consumption (and therefore performance). If you open it too wide, an attacker can simply make such an attack - flooding your server with false requests, each of which allocates as much memory as they can get, eventually leading your server (similar denial of service attacks quite common).

+5
source share

You need to increase the quota according to the web service. One side effect that I can come up with if you use very large values ​​is to increase memory usage, but you can safely increase it to a suitable value without any adverse effects.

0
source share

All Articles