CN102497431B - Tcp one kind of connection memory allocation method and system for application data cache - Google Patents

Tcp one kind of connection memory allocation method and system for application data cache Download PDF

Info

Publication number
CN102497431B
CN102497431B CN 201110415220 CN201110415220A CN102497431B CN 102497431 B CN102497431 B CN 102497431B CN 201110415220 CN201110415220 CN 201110415220 CN 201110415220 A CN201110415220 A CN 201110415220A CN 102497431 B CN102497431 B CN 102497431B
Authority
CN
China
Prior art keywords
node
module
application
step
buffer
Prior art date
Application number
CN 201110415220
Other languages
Chinese (zh)
Other versions
CN102497431A (en
Inventor
刘灿
刘朝辉
窦晓光
纪奎
邵宗有
Original Assignee
曙光信息产业(北京)有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 曙光信息产业(北京)有限公司 filed Critical 曙光信息产业(北京)有限公司
Priority to CN 201110415220 priority Critical patent/CN102497431B/en
Publication of CN102497431A publication Critical patent/CN102497431A/en
Application granted granted Critical
Publication of CN102497431B publication Critical patent/CN102497431B/en

Links

Abstract

本发明提供一种TCP连接缓存应用数据的方法,其特征在于,TCP连接在应用负载小的情况下,从静态缓存池中申请获得固定长度的缓冲区块;而在应用负载大的情况下,从操作系统动态申请固定长度的缓冲区块。 The present invention provides a method for TCP connection caching application data, characterized in that, TCP connections at low load applications, the static cache buffer pool application is a fixed length block; and in the application of large load, dynamic application buffer of fixed length blocks from the operating system. 与现有技术相比,本发明的有益效果在于:很好的支持了上层应用暂存负载进行内容分析,在上层应用内存负载小,能快速的从静态缓存池中获取资源;在上层应用内存负载大时,也能做适当的缓冲,避免丢包。 Compared with the prior art, the beneficial effects of the present invention is: very good support for the upper application staging load content analysis, in small upper application memory load, can quickly access to resources from the static buffer pool; in the upper application memory when a large load, but also do an appropriate buffer, to avoid packet loss.

Description

一种TCP连接缓存应用数据的内存申请方法和系统 Application data by TCP connection cache memory systems and to apply

技术领域 FIELD

[0001] 本发明属于网络安全领域,具体涉及一种TCP连接缓存应用数据的内存申请方法和系统。 [0001] The present invention belongs to the field of network security, particularly relates to a method and system for memory applications TCP connection caching application data.

背景技术 Background technique

[0002] 随着网路的高速发展,网路给人们带来了便利,同时带来不少问题。 [0002] With the rapid development of the Internet, the Internet has brought convenience to people, and bring a lot of problems. 如:色情,反政府舆论等都可以通过网络来传输。 Such as: pornography, anti-government opinion and so can be transmitted through the network. 因此,对网络的监控的重要性也越来越显著。 Therefore, the importance of network monitoring has become increasingly significant. 当前网络大部分采用TCP/IP的四层模型,若要对应用层中数据内容进行监控,必须对数据包的应用负载内容进行检查。 Most current network using TCP / IP four-layer model, to monitor the content data in the application layer, the application must check the load of the contents of the packet. 在TCP/IP模型下,只要在传输层对负载分析即可。 In the TCP / IP model, the load can be analyzed as long as the transport layer. 基于TCP连接的应用,可以对每个TCP连接的数据进行检查,确定其内容是否非法。 TCP-based application access, data can be checked for each TCP connection, to determine whether its content is illegal.

[0003] 专利号CN200580031571.0(在网络元件处缓存内容和状态数据)公开了用于在网络元件处缓存内容和状态数据的方法。 [0003] Patent No. CN200580031571.0 (data cache and network element status) discloses a method for caching data at a network element contents and status. 在一个实施例中,在网络元件处截取数据。 In one embodiment, the data taken at the network element. 从数据分组中确定指定向服务器应用对指定数据的请求的应用层消息。 Specifies the message to the application layer determines the server application requesting the specified data from the data packets. 确定包含在网络元件的缓存中的指定数据的第一部分。 Determining a first portion comprising the specified data in the cache in the network element. 向服务器应用发送请求未包含在缓存中的数据的第二部分的消息。 Transmission request data is not contained in the cache server application message to the second portion. 接收包含第二部分但不包含第一部分的第一响应。 Receiving a second portion of the first response but does not include a first portion. 向客户端应用发送包含第一和第二部分的第二响应。 To the client application transmits a second response to the first and second portions. 在一个实施例中,在网络元件处截取数据分组。 In one embodiment, the interception of data packets at the network element. 从数据分组中确定指定会话或数据库连接状态信息的应用层消息。 Determining a session or application layer message specifies state information database connection from the data packets. 在网络元件处缓存状态信息。 Buffer status information in a network element.

[0004] 专利号CN200680012181. 3(分布式数据管理系统及其动态订阅数据的方法)公开了一种分布式数据管理系统,包括:应用模块(1)和数据管理器(2);所述应用模块(1) 中设有数据访问模块(11)和数据缓存器(12);所述数据管理器(2)中设有订阅管理模块(21)、订阅列表模块(22)、通知模块(23)和数据存储器(24);另外,所述应用模块(1)中还设有动态订阅管理模块(14)和数据记录模块(15);所述数据管理器(2)中还设有数据发布模块(25),该数据发布模块(25)与所述数据存储器(24)连接;所述动态订阅管理模块(14)分别与所述数据记录模块(15)、所述数据缓存器(12)以及所述数据访问模块(11)连接,与所述订阅管理模块(21)、所述通知模块(23)以及所述数据发布模块(25)通信连接; 本发明还包括一种动态订阅数据的方法。 . [0004] Patent No. CN200680012181 3 (distributed data management system and method of dynamic subscription data) discloses a distributed data management system, comprising: an application module (1) and a data manager (2); the application module provided with a data access module (11) and a data buffer (12) (1); and said data manager (2) is provided with the subscription management module (21), subscription list module (22), a notification module (23 ) and data memory (24); in addition, the application module (1) further provided with a dynamic subscription management module (14) and a data recording module (15); said data manager (2) was also provided with a data publishing module (25), the data distribution module (25) and the data memory (24); said dynamic subscription management module (14) respectively to said data recording module (15), said data buffer (12) and the data access module (11) is connected to the subscription management module (21), said notification module (23) and said data distribution module (25) connected to a communication; present invention further comprises a dynamic subscription data method. 采用本发明,可有效减小网络传输和系统处理的数据量,减轻网络负担,提高系统的工作性能。 According to the present invention can effectively reduce the amount of data transmission networks and processing systems, reduce the network load, improve system performance.

[0005] 上述tcp卸载系统中,软硬件不配置或只配置对少量的缓冲区用于缓存应用数据。 [0005] The tcp unloading system, hardware configuration is not configured or only a small amount of buffer for caching application data.

[0006] 上述技术的缺点是:在tcp卸载系统中,硬件不配置或只配置对少量的缓冲区用于缓存应用数据。 Drawback [0006] The art is: tcp unloading system, the hardware configuration is not or only a small amount of buffer configured for caching application data. 对于TCP连接的负载内容不做检查,有不支持为上层应用暂时缓存部分数据,因此,不能很好的配合上层应用的内容分析,在上层应用较忙时,也只能丢包。 For load content not check the TCP connection, there is no support for the upper part of the application temporarily cached data, therefore, can not be very good with the content of the upper layer application analysis, when the upper application is busy, can only loss.

发明内容 SUMMARY

[0007] 本发明克服现有技术的不足,提供应用的缓存分配机制,能为每个连接静态分配一定容量的内存,当内存不够时,通过动态分配从0S获得内存资源动静结合,即节省资源又能尽快满足应用需求。 [0007] The present invention overcomes the deficiencies of the prior art, the buffer allocation mechanism provided application can be certain static allocation of memory capacity for each connection, when the memory is not enough, obtained from dynamic and static memory 0S resources through dynamic allocation, i.e., to save resources but also to meet the needs of the application as soon as possible.

[0008] 本发明提供了一种TCP连接缓存应用数据的内存申请方法,其包括如下步骤: [0008] The present invention provides a method of application memory TCP connection caching application data, comprising the steps of:

[0009] (1)初始化,根据应用规模为流缓存节点按多种尺度(如三种尺度,5k,1.5k, 〇.5k)申请数个节点组成静态池,转步骤(2); [0009] (1) initialization, depending on the application size of the stream buffer node according to a variety of scales (e.g., three kinds of scale, 5k, 1.5k, 〇.5k) applying a plurality of nodes static pool, go to step (2);

[0010] (2)流节点申请转步骤(3);流节点释放转步骤(7); [0010] (2) the application to the streaming node in step (3); flow node releases go to step (7);

[0011] (3)从静态池中申请空闲节点,如果申请成功,则进入步骤(5),否则进入步骤(4); [0011] (3) Application from a static pool of free nodes, if the application is successful, the process proceeds to step (5), otherwise go to step (4);

[0012] (4)从操作系统申请动态流缓存节点(大小为静态中能满足需求最小的一种),如果申请成功,则进入步骤(5),否则进入步骤(6); [0012] (4) from the operating system to apply for the stream buffer node (static in size to meet the minimum needs of a), if the application is successful, the process proceeds to step (5), otherwise go to step (6);

[0013] (5)返回节点头指针,转步骤(11); [0013] (5) returns a pointer section nod, go to step (11);

[0014] (6)返回空指针,转步骤(11); [0014] (6) returns a null pointer, go to step (11);

[0015] (7)流缓存节点有动态申请标志转步骤(8),否则转步骤(9); [0015] (7) the stream request flag dynamic caching node go to step (8), otherwise go to step (9);

[0016] (8)静态池中,相同尺度的流缓存节点数小于设定阈值(如:lk个),转步骤 [0016] (8) in the static pool, the same scale of the stream buffer is smaller than the set threshold number of nodes (eg: lk a), go to step

[0017] (9),否则转步骤(10); [0017] (9), otherwise go to step (10);

[0018] (9)流缓存节点放入静态池中,转步骤(11); [0018] (9) flow into the static pool caching node, go to step (11);

[0019] (10)流缓存节点归还给操作系统,转步骤(11); [0019] (10) returned to the stream buffer node operating system, go to step (11);

[0020] (11)结束。 [0020] (11) End.

[0021] 本发明提供的TCP连接缓存应用数据的内存申请方法,步骤(3)中TCP连接从静态的缓存池中的空闲缓冲区链表中申请获得固定长度len的缓冲区块。 [0021] The present invention provides a method to apply a TCP connection cache memory application data, the step (3) is a TCP connection request from the free buffer list static cache buffer pool obtained in the fixed-length blocks len.

[0022] 本发明提供的TCP连接缓存应用数据的内存申请方法,步骤(4)中TCP连接从操作系统动态地申请获得固定长度len的缓冲区块。 [0022] The present invention provides a method to apply a TCP connection cache memory application data, the step (4) in the TCP connection request from the operating system to dynamically obtain a buffer of fixed-length blocks len.

[0023] 本发明提供的TCP连接缓存应用数据的内存申请方法,步骤(7)〜(10)中根据被释放节点的标识和静态池中相同尺度的节点个数(与静态池中相同尺度的预设阈值比较) 确定节点由静态池回收还是操作系统回收。 [0023] TCP connection cache memory allocation method of the present invention, the application data provided to (10) according to the number of nodes and the node identifier is released the same scale static pool of the same scale in step (7) (static pool preset threshold value) to determine the node or operating system recovery from a static pool recycling.

[0024] 本发明提供的TCP连接缓存应用数据的内存申请方法,所述TCP连接关闭或淘汰时,也采用节点回收的(7)〜(10)模块来处理。 Memory application method [0024] The present invention provides a TCP connection caching application data, when the TCP connection is closed or eliminated, also be employed (7) to (10) to process the recovered node module.

[0025] 本发明还提供了一种TCP连接缓存应用数据的内存申请的系统,其包括如下模块: [0025] The present invention also provides a system for a TCP connection request cache memory application data, comprising the following modules:

[0026] (1)初始化模块,根据应用规模为流缓存节点按多种尺度申请数个节点组成静态池; [0026] (1) initialize the module, depending on the application size of the stream buffer node according to a variety of scales apply static pool of several nodes;

[0027] (2)申请静态缓冲区块模块,流节点申请转模块⑶;流节点释放转模块(7); [0027] (2) applying a static buffer block module, the application to the module ⑶ streaming node; forwarding node releases the flow module (7);

[0028] (3)从静态池中申请空闲节点,如果申请成功,则进入模块(5),否则进入模块(4); [0028] (3) Application from a static pool of free nodes, if the application is successful, the module (5), otherwise go to module (4);

[0029] (4)申请动态缓冲区模块,从操作系统申请动态流缓存节点,如果申请成功,则进入模块(5),否则进入模块(6); [0029] (4) apply dynamic buffer module, the operating system from caching node application dynamic flow, if the application is successful, the module (5), otherwise go to module (6);

[0030] (5)返回节点头指针,转模块(11); [0030] (5) returns a pointer section nod, transfer module (11);

[0031] (6)返回空指针,转模块(11); [0031] (6) returns a null pointer, switch module (11);

[0032] (7)流缓存节点有动态申请标志转模块(8),否则转模块(9); [0032] (7) the stream buffer transfer request flag dynamic node module (8), otherwise go to module (9);

[0033] (8)静态池中,相同尺度的流缓存节点数小于设定阈值,转模块(9),否则转模块(10); [0033] (8) in the static pool, the stream buffer section the same scale points less than a set threshold, the transfer module (9), otherwise the transfer module (10);

[0034] (9)流缓存节点放入静态池中,转模块(11); [0034] (9) flow into the node cache static pool, transfer module (11);

[0035] (10)流缓存节点归还给操作系统,转模块(11); [0035] (10) returned to the stream buffer node operating system, transfer module (11);

[0036] (11)结束; [0036] (11) ends;

[0037] 其中,初始化模块中所述的尺度包括三种,分别为:5k,1.5k,0. 5k;申请动态缓冲区模块中所述节点大小为静态中能满足需求最小的一种。 [0037] wherein said initialization module includes three dimensions, respectively:. 5k, 1.5k, 0 5k; Application in the dynamic buffer module is a static node size in a need to meet the minimum.

[0038] 本发明还提供的TCP连接缓存应用数据的内存申请系统,模块(2)中TCP连接从静态的缓存池中的空闲缓冲区链表中申请获得固定长度len的缓冲区块。 [0038] The present invention further provides a TCP connection cache memory application data application system, module (2) in a TCP connection request to obtain fixed-length blocks len buffer from the free buffer list in the static buffer pool.

[0039] 本发明还提供的TCP连接缓存应用数据的内存申请系统,模块(4)中TCP连接从动态的缓存池中的空闲缓冲区链表中申请获得固定长度len的缓冲区块。 [0039] The present invention further provides a TCP connection cache memory application data application system module (4) in a TCP connection request from the free buffer list dynamic cache buffer pool obtained in the fixed-length blocks len.

[0040] 本发明还提供的TCP连接缓存应用数据的内存释放系统,模块(7、8、9、10)中根据流缓冲节点的标志(动态申请还是静态申请)和静态缓冲池中的流缓存节点数,确定缓冲节点回收给静态池还是操作系统。 The stream buffer [0040] memory release system of the present invention further provides a TCP connection caching application data module (7,8,9,10) according to the stream buffer node flag (application dynamic or static application) and static buffer pool the number of nodes, the nodes to determine the recovery of the static buffer pool or the operating system.

[0041] 本发明提供的TCP连接缓存应用数据的内存申请系统,所述TCP连接关闭或淘汰时,也采用节点回收的(7)〜(10)模块来处理。 [0041] The present invention provides a TCP connection cache memory allocation system application data, when the TCP connection is closed or eliminated, also be employed (7) to (10) to process the recovered node module.

[0042] 与现有技术相比,本发明的有益效果在于:很好的支持了上层应用暂存负载进行内容分析,在上层应用CPU负载大时,也能做适当的缓冲,避免丢包;将静态申请和动态申请结合,兼顾了申请速度和申请的效率,系统流缓存节点消耗少时,直接从静态池中获取, 实现快速申请。 [0042] Compared with the prior art, the beneficial effects of the present invention: good support upper temporary load application content analysis, when the upper application CPU load is large, an appropriate buffer can do to avoid the loss; the application of static and dynamic applications combine, taking into account the speed of application and application efficiency, system flow cache node consumes little time, directly from the static pool for fast application. 系统流缓存节点消耗大时,从操作系统获取,有效地利用了操作系统资源。 Large cache node system stream consumption acquired from the operating system, the operating system effectively utilize resources. 静态释放和动态释放结合,从静态池中申请的流缓存节点,释放给静态池,从操作系统申请的动态节点,根据系统消耗的静态节点情况,确定释放给静态池还是操作系统。 Static and dynamic release release binding, the stream buffer pool static node application, released to the pool static, dynamic node operating system from the application, the static consumption of the system node determines to release static pool or the operating system. 可以划分成以下几点:1.避免从操作系统频繁地申请和释放流缓存节点,一定数目的缓存直接从优先申请的流缓存节点池中申请和释放;2.当静态池中的流缓存节点不够时,可以从操作系统中申请,满足应用需求;3.流缓存节点在释放时,根据流缓存节点的标志(从静态缓存获得还是操作系统动态获得)和系统对静态池中的空闲流缓存节点的情况,来判断释放给静态池还是操作系统。 Can be divided into the following: a stream buffer to avoid application and release node, a certain number of the stream buffer cache priority application directly from the node pool frequent application and release from the operating system; stream 2 when a cache node in the static pool. when not enough, you can apply from the operating system to meet the application requirements; 3 stream cache nodes at the time of release, according to the flag stream cache node (obtained from the static cache is dynamically obtain operating system) and a system of free static pool of a stream buffer case nodes to determine the static pool or released to the operating system.

附图说明 BRIEF DESCRIPTION

[0043] 图1是本发明流程示意图。 [0043] FIG. 1 is a flow schematic of the present invention.

具体实施方式 Detailed ways

[0044] 参见图1的本发明流程示意图,本发明的方法是如下进行的: Schematic flow chart of the present invention [0044] Referring to Figure 1, the method of the present invention is carried out as follows:

[0045] 1.为TCP连接从静态的缓存池中的空闲缓冲区链表中申请获得固定长度len (以后说的len即为固定长度的len)的缓冲区块。 [0045] 1. a TCP connection request to obtain a fixed length len (len is the later of said fixed length len) in block buffer from the free buffer list in the static buffer pool.

[0046] 2.步骤1失败,则静态内存不够,则动态申请len的缓冲区,若申请失败,则说明系统资源耗尽,返回空,动态申请成功,则把此缓冲区的信息节点连接到动态链表中,在信息节点中记录动态标志,步骤1成功,则把缓冲区块连接到连接到静态链表中,在信息节点中记录动态标志; [0046] 2. Step 1 fails, the static memory is not enough, the dynamic application buffer len, if the application fails, the system resources are exhausted, returned empty, dynamic application is successful, put this buffer is connected to the node information dynamic linked list, dynamic record mark, the step of success information of the node 1, the buffer block connected to the connector put to a static list, a recording mark in the dynamic information of the node;

[0047] 3. TCP连接关闭或淘汰时,根据信息节点的标志,把缓冲区返回给系统或放回静态空闲链表。 [0047] 3. TCP connection is closed or eliminated, according to the flag information node, the buffer is returned to the system or replace a static free list.

[0048] 本发明首先静态分配一片缓存作为缓存池,满足正常流量下TCP流的缓存,在流量较大时,动态分配缓存,当流量恢复正常水平后,按一定的策略把动态分配的缓存返回给系统。 [0048] First, the present invention is a statically allocated as cache buffer pool, the cache satisfies the normal TCP traffic flows, when the flow is large, dynamic allocation of buffers, when the flow rate returns to normal levels, according to a certain policy cache return the dynamically allocated to the system. 缓冲保存上传给应用的数据,根据需求上传给应用。 Buffer to hold uploaded data applications, according to the application needs to upload. 从而解决为tcp连接缓存应用层数据提供一种内存分配机制的问题。 Thereby to provide a solution for the memory allocation application layer data cache tcp connection problems.

[〇〇49] 以上实施例仅用以说明本发明的技术方案而非对其限制,尽管参照上述实施例对本发明进行了详细的说明,所述领域的普通技术人员应当理解:依然可以对本发明的具体实施方式进行修改或者同等替换,而未脱离本发明精神和范围的任何修改或者等同替换, 其均应涵盖在本发明的权利要求范围当中。 [〇〇49] above embodiments are intended to illustrate the present invention but not to limit, although the above-described embodiments with reference to embodiments of the present invention has been described in detail, one of ordinary skill in the art should be understood: The present invention still equivalent modifications or alternative particular embodiment, without departing from the spirit and scope of any modifications or equivalents of the present invention, which should fall within the scope of the present invention as claimed in accompanying claims.

Claims (8)

1. 一种TCP连接缓存应用数据的方法,其包括如下步骤: (1) 初始化,根据应用规模为流缓存节点按多种大小申请数个节点组成静态池,转步骤(2); (2) 流缓存节点申请转步骤(3);流缓存节点释放转步骤(7); (3) 从静态池中申请空闲节点,如果申请成功,则进入步骤(5),否则进入步骤(4); (4) 从操作系统申请动态流缓存节点,如果申请成功,则进入步骤(5),否则进入步骤(6); (5) 返回节点头指针,转步骤(11); (6) 返回空指针,转步骤(11); (7) 流缓存节点有动态申请标志转步骤(8),否则转步骤(9); (8) 静态池中,与当前释放的流缓存节点大小相同的流缓存节点数小于设定阈值,转步骤(9),否则转步骤(10); (9) 流缓存节点放入静态池中,转步骤(11); (10) 流缓存节点归还给操作系统,转步骤(11); (11) 结束; 其中,步骤(1)中所述流缓存节点的大小包括三 CLAIMS 1. A method for TCP connection caching application data, comprising the steps of: (1) initialization, depending on the application size of the stream buffer node by applying a variety of sizes of several pool static nodes, go to step (2); (2) application stream cache node go to step (3); the stream buffer node releases go to step (7); (3) applying a static pool from idle node, if the application is successful, the process proceeds to step (5), otherwise go to step (4); ( 4) from the operating system to apply for the stream cache node, if the application is successful, the process proceeds to step (5), otherwise go to step (6); (5) return section nod pointer, go to step (11); (6) returns a null pointer, go to step (11); (7) the stream request flag dynamic caching node go to step (8), otherwise go to step (9); (8) in the static pool, and the stream cache node current release of the same size flow cache nodes less than a set threshold, proceed to step (9), otherwise go to step (10); (9) flow into the static pool caching node, go to step (11); return (10) to the operating system stream buffer node, go to step ( 11); (11) ends; wherein step (a size) in the stream cache node comprises three 种,分别为:5KB、1.5KB、0. 5KB;步骤(4)中所述动态流缓存节点的大小为静态池中能满足申请动态流缓存节点需求的最小的一种流缓存节点大小; 步骤(7)〜(10)中根据流缓存节点的动态申请标志和静态池中与当前释放的流缓存节点大小相同的流缓存节点数,确定流缓存节点由静态池回收还是操作系统回收。 Species, respectively: 5KB, 1.5KB, 0 5KB; step (4) the size of the flow dynamic cache node is static pool to meet the minimum size of a stream buffer node application dynamic flow demand cache node; step. (7) to (10) of the current node and the stream buffer release request flag according to the same dynamic flow and static cache node buffer pool size of flow nodes, determining the stream buffer node or operating system from a static pool recycling recovered.
2. 根据权利要求1所述的方法,其特征在于,步骤(3)中TCP连接从静态池中的空闲缓冲区链表中申请获得固定长度len的缓冲区块。 2. The method according to claim 1, characterized in that, in a TCP connection in step (3) to obtain application buffer len fixed length block from the free buffer list of static pool.
3. 根据权利要求1或2所述的方法,其特征在于,步骤(4)中TCP连接从操作系统动态地申请获得固定长度len的缓冲区块。 3. The method of claim 1 or claim 2, wherein, in step (4) in the TCP connection request from the operating system to dynamically obtain a buffer of fixed-length blocks len.
4. 根据权利要求1所述方法,其特征在于,所述TCP连接关闭或淘汰时,也采用节点回收的步骤(7)〜(10)来处理。 4. The method according to claim 1, wherein, when the TCP connection is closed or eliminated, also used in step (7) recovering the node to (10) processed.
5. -种TCP连接缓存应用数据的内存申请的系统,其包括如下模块(1)〜(11): 模块(1):初始化模块,根据应用规模为流缓存节点按多种大小申请数个节点组成静态池; 模块(2):流缓存节点申请转模块(3);流缓存节点释放转模块(7); 模块⑶:从静态池中申请空闲节点,如果申请成功,则进入模块(5),否则进入模块(4); 模块(4):从操作系统申请动态流缓存节点,如果申请成功,则进入模块(5),否则进入模块(6); 模块(5):返回节点头指针,转模块(11); 模块(6):返回空指针,转模块(11); 模块(7):流缓存节点有动态申请标志,转模块(8),否则转模块(9); 模块(8):静态池中,与当前释放的流缓存节点大小相同的流缓存节点数小于设定阈值,转模块(9),否则转模块(10); 模块(9):流缓存节点放入静态池中,转模块(11); 模块(10):流缓存节点归还给操作系 5. - System Species TCP connection request cache memory of the application data, comprising the module (1) to (11): Module (1): initialization module, according to the application by the size of the stream buffer node number of nodes of various sizes Application composition static pool; module (2): stream the application to the caching node module (3); forwarding node releases the stream buffer module (7); ⑶ module: applying a static pool from idle node, if the application is successful, the module (5) otherwise, proceeds to block (4); means (4): from the operating system to apply for the stream cache node, if the application is successful, the module (5), otherwise go to module (6); means (5): return section nod pointer, forwarding module (11); means (6): returns a null pointer, switch module (11); means (7): the stream buffer nodes dynamic request flag, transfer module (8), otherwise go to the module (9); means (8 ): static pool, and the stream cache node same size as the current release of the stream buffer nodes less than a set threshold, the turn module (9), otherwise the transfer module (10); means (9): the stream buffer pool static nodes into , the transfer module (11); means (10): the stream returned to the operating system caching node ,转模块(11); 模块(11):结束; 其中,初始化模块中所述流缓存节点的大小包括三种,分别为:5KB、1. 5KB、0. 5KB ;模块(4)中所述动态流缓存节点大小为静态池中能满足申请动态流缓存节点需求的最小的一种流缓存节点大小; 模块(7)〜(10)中根据流缓存节点的动态申请标志和静态池中与当前释放的流缓存节点大小相同的流缓存节点数,确定流缓冲节点回收给静态池还是操作系统。 , Transfer module (11); means (11): End; wherein, in the size of the stream buffer initialization module includes three nodes, respectively:.. 5KB, 1 5KB, 0 5KB; module (4) in the dynamic stream buffer pool static node size to meet the minimum size of a stream buffer node cache node dynamic flow demand application; module (7) to (10) according to a dynamic stream buffer request flag and the node with the current static pool the same size of the stream buffer node releases the stream buffer nodes, the nodes determine the flow recycled to the static buffer pool or the operating system.
6. 根据权利要求5所述的系统,其特征在于,模块(3)中TCP连接从静态池中的空闲缓冲区链表中申请获得固定长度len的缓冲区块。 6. A system as claimed in claim 5, characterized in that the module (3) in the TCP connection request to obtain fixed-length blocks len buffer from the free buffer list of static pool.
7. 根据权利要求5或6所述的系统,其特征在于,模块(4)中TCP连接从操作系统动态地申请获得固定长度len的缓冲区块。 7. A system according to claim 5 or claim 6, characterized in that the module (4) in the TCP connection request from the operating system to dynamically obtain a buffer of fixed-length blocks len.
8. 根据权利要求5所述系统,其特征在于,所述TCP连接关闭或淘汰时,也采用节点回收的⑵〜(10)模块来处理。 8. The system according to claim 5, wherein, when the TCP connection is closed or eliminated, the node also uses recycled ⑵~ (10) module to handle.
CN 201110415220 2011-12-13 2011-12-13 Tcp one kind of connection memory allocation method and system for application data cache CN102497431B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN 201110415220 CN102497431B (en) 2011-12-13 2011-12-13 Tcp one kind of connection memory allocation method and system for application data cache

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN 201110415220 CN102497431B (en) 2011-12-13 2011-12-13 Tcp one kind of connection memory allocation method and system for application data cache

Publications (2)

Publication Number Publication Date
CN102497431A CN102497431A (en) 2012-06-13
CN102497431B true CN102497431B (en) 2014-10-22

Family

ID=46189216

Family Applications (1)

Application Number Title Priority Date Filing Date
CN 201110415220 CN102497431B (en) 2011-12-13 2011-12-13 Tcp one kind of connection memory allocation method and system for application data cache

Country Status (1)

Country Link
CN (1) CN102497431B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103761192B (en) * 2014-01-20 2016-08-17 华为技术有限公司 A method and apparatus for memory allocation

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1444812A (en) 2000-07-24 2003-09-24 睦塞德技术公司 Method and apparatus for reducing pool starvation in shared memory switch
CN1798094A (en) 2004-12-23 2006-07-05 华为技术有限公司 Method of using buffer area
EP1890425A1 (en) 2005-12-22 2008-02-20 Huawei Technologies Co., Ltd. A distributed data management system and a method for data dynamic subscribing

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7664879B2 (en) * 2004-11-23 2010-02-16 Cisco Technology, Inc. Caching content and state data at a network element

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1444812A (en) 2000-07-24 2003-09-24 睦塞德技术公司 Method and apparatus for reducing pool starvation in shared memory switch
CN1798094A (en) 2004-12-23 2006-07-05 华为技术有限公司 Method of using buffer area
EP1890425A1 (en) 2005-12-22 2008-02-20 Huawei Technologies Co., Ltd. A distributed data management system and a method for data dynamic subscribing

Also Published As

Publication number Publication date
CN102497431A (en) 2012-06-13

Similar Documents

Publication Publication Date Title
Bronson et al. {TAO}: Facebook’s Distributed Data Store for the Social Graph
US7813277B2 (en) Lockless bandwidth management for multiprocessor networking devices
US8458331B2 (en) Systems and methods for connection management for asynchronous messaging over HTTP
KR101863024B1 (en) Distributed load balancer
CN100468377C (en) Apparatus and method for supporting memory management in an offload of network protocol processing
US8111707B2 (en) Compression mechanisms for control plane—data plane processing architectures
US7864764B1 (en) Accelerated packet processing in a network acceleration device
Higgins et al. Intentional networking: opportunistic exploitation of mobile network diversity
US8843645B2 (en) Systems and methods for detecting incomplete requests, TCP timeouts and application timeouts
US9705800B2 (en) Load distribution in data networks
US20110185082A1 (en) Systems and methods for network virtualization
CN1315077C (en) System and method for efficient handling of network data
US20020154645A1 (en) System for bypassing a server to achieve higher throughput between data network and data storage system
JP2006005402A (en) Communication statistic collection apparatus
KR20030019900A (en) Parallel information delivery method based on peer-to-peer enabled distributed computing technology and the system thereof
CN101217467B (en) An inter-core load dispensing device and method
JP2001526814A (en) Distributed cache, prefetching, replication method and system
JP2001265641A (en) System and method for intellectual fetch and delivery of web content
CN101997924A (en) Cloud storage file transfer protocol (CFTP)
WO2010060106A1 (en) Adaptive network content delivery system
CN102546738A (en) System and method for allocating resources based on events in a network environment
US20140280606A1 (en) Method and Apparatus for Content Management
US20110131654A1 (en) Systems and methods for aggressive window probing
CN105580318A (en) Port mirroring for sampling measurement of network flows
CN101207550A (en) Load balancing system and method for multi business to implement load balancing

Legal Events

Date Code Title Description
C06 Publication
C10 Request of examination as to substance
C14 Granted