netfilter.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Medialy <medialy@gmail.com>
To: netfilter@vger.kernel.org
Subject: Why "No buffer space available"?
Date: Tue, 29 Dec 2009 10:49:56 +0800	[thread overview]
Message-ID: <cc73a9220912281849qf25a81evdb6082197d037917@mail.gmail.com> (raw)
In-Reply-To: <cc73a9220912281846h6a337b76ud7d9d1f61371f21e@mail.gmail.com>

Hi,
I have written a program to log the nat behavior. the program works
well when traffic is low. But when the traffic reaches 1Gb, program
always error.
According to the previous discussions about this problem, I even set
the recv buffer size to 50MB and the error still exists.
For every callback, format the data and then put it into the queue
directly.  The formating of data causes less then 1 second for 0.65
million records.
Errors always occurs  when there are less than 10 log records.
Is anyone who can help?
Thanks.

Setting:
    Redhat Enterprise Linux 5
    libnetfilter_conntrack-0.0.100
    libnfnetlink-1.0.0
    recv buffer size: 50MB
    nfct_open(CONNTRACK, NF_NETLINK_CONNTRACK_NEW|NF_NETLINK_CONNTRACK_DESTROY)
    1Gb nat traffic, 0.65 million records per minute
    circular queue size: 1 million

Error:
    nfct_catch error: No buffer space available

Program Structure:
    Callback:
        lock;
        if log number > MAX_LOG_NUM:
            discard
        else:
            put log in circular queue
            log number += 1
        unlock

    Thread 2:
        lock;
        if log number >0 :
            get lock number
        unlock
        process log data in circular queue
        lock
        log number = log number - log number processed
        unlock

       reply	other threads:[~2009-12-29  2:49 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <cc73a9220912281846h6a337b76ud7d9d1f61371f21e@mail.gmail.com>
2009-12-29  2:49 ` Medialy [this message]
2009-12-30 12:10   ` Why "No buffer space available"? Pablo Neira Ayuso
     [not found]     ` <c29e3bea0912301743k7f7bda48o17ce78d4521a7585@mail.gmail.com>
2009-12-31 11:31       ` Pablo Neira Ayuso

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cc73a9220912281849qf25a81evdb6082197d037917@mail.gmail.com \
    --to=medialy@gmail.com \
    --cc=netfilter@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).