Patent ID: 8782221

Claim:
A method for allocating buffers for a TCP proxy session between a client and a server by a service gateway comprising a processor, comprising: monitoring, by the processor, dynamic server side network behaviors for a server side session of the TCP proxy session and dynamic client side network behaviors for a client side session of the TCP proxy session; and allocating, by the processor, capacity for a server side buffer and capacity for a client side buffer in a memory buffer based on the dynamic server side network behaviors, the dynamic client side network behaviors, and a weighted average of a capacity of the memory buffer, the allocating comprising: receiving a server side session data packet from the server, or receiving a client side session data packet from the client; determining whether an available capacity of the server side buffer is sufficient to store the server side session data packet, or determining whether an available capacity of the client side buffer is sufficient to store the client side session data packet; in response to determining that the available capacity of the server side buffer is not sufficient to store the server side session data packet, increasing the allocated capacity of the server side buffer, or in response to determining that the available capacity of the client side buffer is not sufficient to store the client side session data packet, increasing the allocated capacity of the client side buffer; and adjusting the available capacity of the server side buffer according to the increase of the allocated capacity of the server side buffer, or adjusting the available capacity of the client side buffer according to the increase of the allocated capacity of the client side buffer.