473,769 Members | 5,787 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Using PostgreSQL to store ip traffic information

Dear friends,

I am currently testing Ulogd ip traffic logging system with PostgreSQL. It
works in conjunction with GNU/Linux iptables.

The Ulogd project can be found here:
http://gnumonks.org/gnumonks/project...details?p_id=1

(If you try the project, fetch it from CVS as the PostgreSQL code was broken
until today.)

My database may aquire up to 100 entries / second.
If possible, I would like to know your point of view about these issues:

1) int4->timestamp cast

uLogd send and int4 (epoq timestamp) to PostgreSQL. I would like to store the
int4 in a timestamp after cast.

The developpers from Ulogd may not accept a cast written in the SQL query
using ::abstime because they want to keep the ability to use an int4.

Therefore, I used the following trick (from PostgreSQL bits):

CREATE OR REPLACE FUNCTION ulogtimecast(in t4)
RETURNS timestamp AS
'select "timestamp"($1: :abstime);'
LANGUAGE 'sql' VOLATILE;

CREATE CAST (int4 AS timestamp)
WITH FUNCTION ulogtimecast(in t4)
AS IMPLICIT;

I am worried that the SQL query may slow down PostgreSQL during heavy INSERTs.
What is the impact on performance? Do you see a smarted way of doing this
cast from in4 to timestamp?

2) Partial indexes

Using a con job, I plan to create partial indexes on Inetd, timestamps and
various columns everyday. This will allow me to index the information from
the past 10 days, but not dig further in indexes.

Is there a smarter way to proceed? Are there special indexes in development
for deep indexing?

3) Hash indexes
is there any interest in storing TCP ports and simple information in hash
indexes? I heard that they were not faster than b-tree.

4) PostgreSQL analysis code
Did anyone work on server-side analysis code written in PL? I plan to use
pgAdmin III for direct queries, but would be interested in any server-side
solution.

Thank you for your answers,
Jean-Michel Pouré
---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to ma*******@postg resql.org

Nov 22 '05 #1
0 1693

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
5950
by: Torsten Schmidt | last post by:
Hi, I'm trying to connect to a mysql-Server using PHP's mysql-function mysql_connect. The host on which the mysql-server is running is not the same as the host apache and php are running on. The two computers are connected in an IPv6-network. No matter if I give the hostname (defined in /etc/hosts), the IPv6-address ("fec0::4") or the IPv6-address in square brackets ("") the function mysql_connect always prints "Unknown MYSQL-Server "....
9
2922
by: Mike Nolan | last post by:
I may need to move a web store to another hosting facility or rewrite it. I will need to be able to tie it to the in-house order entry system (which is/will be in Postgresql) for inventory status information. Are there any commercial web store/shopping cart packages or host sites that run under PostgreSQL? I found one web store package in the pgsql project archives, but it looks like it may need a lot of tinkering to get it working....
3
2638
by: Bob.Henkel | last post by:
I write this to tell you why we won't use postgresql even though we wish we could at a large company. Don't get me wrong I love postgresql in many ways and for many reasons , but fact is fact. If you need more detail I can be glad to prove all my points. Our goal is to make logical systems. We don't want php,perl, or c++ making all the procedure calls and having the host language to be checking for errors and handleing all the...
1
2219
by: jbi130 | last post by:
I have a 3 tier client/server application where the client connection to the server which then uses PostgreSQL. I'd like to extend the client to have direct access to PostgreSQL but do not want to open up postgresql to the internet. So, I'd like to tunnel the libpq connection over the existing secure socket. My preferred solution would be for the client to pass libpq an already connected file descriptor (so I can prevent binding a port...
20
6641
by: Keith G. Murphy | last post by:
I'm trying to get a feel for what most people are doing or consider best practice. Given a mod_perl application talking to a PostgreSQL database on the same host, where different users are logging onto the web server using LDAP for authentication, do most people 1) have the web server connecting to the database using its own user account (possibly through ident), and controlling access to different database entities strictly through...
3
6206
by: Robert Abi Saab | last post by:
Hi everyone. I just finished a course on PostgreSQL and I found out that PostgreSQL doesn't provide any object relational features (as claimed in the official documentation), except table inheritance and very limited user defined types (I defined a UDT with 2 attributes and couldn't use it in a table, and the trainer said it must contain 1 attribute at most so that it can be used (as a column) in tables) So my question is whether...
0
1440
by: Rob Oakley | last post by:
I have an embedded system running FreeBSD (5.1) that does not have any local (rotating) storage (i.e disk drives). PostgreSQL also runs on this box and (at this point) has two tables. It is an extremely simple PostgreSQL configuration with the tables having less than 20 fields each, and no relations between the tables. However, because there isn't any (substantial) local storage available on the Compact Flash, and the tables have the...
19
2832
by: Mike Cox | last post by:
Obviously, there cannot be 21 postgresql groups in the comp.* hierarchy. Many of the 21 are not used that often, and would not be of much popularity to those on usenet. I did a check on news.postgresql.org to see which newsgroups are the most popular and also the ones which cover the relevant postgresql topics. Most of the postgresql topics and traffic are represented in these four newsgroups: comp.databases.postgresql.admin
2
2102
by: matt | last post by:
Does anyone know of a service, that provides driving traffic information in the form of xml? I see several large cities have information on the web, including traffic cameras. traffic.com has an RSS feed which has some information but when i looked at it, you can't really tell where the traffic problem is. The goal is to write a program that can take your location, such as zip code, or road/direction/city, or lat/long coordinates and...
0
9583
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9423
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10210
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10039
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9990
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8869
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6668
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5297
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5445
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.