Internet.com
Get your
ISP-News
courtesy of
internetnews.com




Search ISP-Lists
Search:
ISP Channel
CLEC-Planet
ISP Glossary
ISP News
ISP-Planet
ISP-Lists
E-mail Newsletters
Opt-in Announcements
Discussion Forums
internet.com
IT
Developer
Internet News
Small Business
Personal Technology
International

Search internet.com
Advertise
Corporate Info
Newsletters
Tech Jobs
E-mail Offers

The ISP-Lists.com Email Discussion List Community

<- Previous Message | Next Message ->
Thread Index
[isp-dns] Re: BIND vs. Sendmail + MIMEDefang/SpamAssassin etc.
  • To: isp-dns@isp-dns.com
  • Subject: [isp-dns] Re: BIND vs. Sendmail + MIMEDefang/SpamAssassin etc.
  • From: "Masood Ahmad Shah" <masood@...>
  • Date: Tue, 6 Apr 2004 03:45:51 +0500

Locking a Memory Object
You can lock and unlock a shared-memory segment into physical memory to
eliminate paging. The MCL_FUTURE argument to the mlockall function causes
new shared-memory regions to be locked automatically.
Example  shows how to map a file into the address space of the process and
lock it into memory. When the file is unmapped, the lock on the address is
removed.


/* This program locks the virtual memory address that */
/* was returned from the mmap() function into memory. */

#include <unistd.h>
#include <sys/types.h>
#include <stdio.h>
#include <sys/file.h>
#include <sys/mman.h>
#include <sys/stat.h>
#include <errno.h>

main()
{
int fd;
caddr_t pg_addr;

int size = 5000;
int mode =  S_IRWXO|S_IRWXG|S_IRWXU;

     /* Create a file */

fd = shm_open("example", O_RDWR|O_CREAT, mode);
if(fd < 0){
   perror("open error ");
   exit();
}

     /* Set the size */

if((ftruncate(fd, size)) == -1){
     perror("ftruncate failure");
     exit();
}

     /* Map the file into the address space of the process */
pg_addr = (caddr_t) mmap(0, size, PROT_READ|PROT_WRITE|PROT_EXEC,
MAP_SHARED,
                         fd, 0);

if(pg_addr == (caddr_t) -1){
  perror("mmap failure");
  exit();
}

     /* Lock the mapped region into memory */

if(mlock(pg_addr,size) != 0){
  perror("mlock failure");
  exit();
}

     /* Unmap of the address region removes the memory lock */
     /* established on the address region by this process   */

if(munmap(pg_addr, size) < 0)
   perror("unmap error");
close(fd);
shm_unlink("example");
exit();
}




Best Regds,
Masood Ahmad Shah
Nexlinx
http://nexlinx.net.pk
http://weblogs.com.pk/jahil


----- Original Message ----- 
From: <wrolf.courtney@...>
To: "Masood Ahmad Shah" <masood@....pk>
Cc: <bind9-users@...>
Sent: Tuesday, May 04, 2004 12:31 AM
Subject: Re: BIND vs. Sendmail + MIMEDefang/SpamAssassin etc.


>
>
>
>
>
> Thanks Masood.
>
> My problem is not that named goes down.
>
> It just does not respond to UDP queries for a while.
>
> My guess is that it is not responding (fast enough) when the system load
is
> high, and swapping activity is high.
>
> Is there anyway that named can be locked into memory, using e.g.
mlockall()
> in Linux?
>
> Wrolf Courtney
>
> "Masood Ahmad Shah" <masood@....pk> wrote on 04/03/2004 01:49:23
> AM:
>
> > spamassassin sendmail and if you have mysql all are memory hungry. if
> named
> > process goes down after sometime and swap exceed. check your ram.
> >
> > you can use DAEMONTOOLS
> http://cr.yp.to/daemontools/daemontools-0.76.tar.gz
> > to run automatically whenever your named process goes down.
> >
> > Best Regds,
> > Masood Ahmad Shah
> > Nexlinx
> > http://nexlinx.net.pk
> > http://weblogs.com.pk/jahil
> >
> >
> > ----- Original Message -----
> > From: <wrolf.courtney@...>
> > To: <bind9-users@...>
> > Cc: <pat.moore@...>
> > Sent: Saturday, May 01, 2004 1:53 AM
> > Subject: BIND vs. Sendmail + MIMEDefang/SpamAssassin etc.
> >
> >
> > >
> > >
> > >
> > >
> > > On two boxes with RedHat 7.2 kernel 2.4.20-28.7 running BIND 9.2.1
> (from
> > > bind-9.2.1-1.7x.2 rpm) and Sendmail, we have the problem that when the
> > > sendmail gets flooded with messages, some swapping occurs, and named
> stops
> > > responding temporarily.
> > >
> > > We can mostly only see this in monitoring software, but occassionally
> it
> > > gives our applications problems.
> > >
> > > The trouble *seems* to be when the load average gets over 15.  The
main
> > > thing going on then is a lot of swapping - I do not know for sure that
> > this
> > > is the problem.
> > >
> > > Is there any way to have named signal that it wants to stay in memory
> all
> > > the time.  E.g.
> > >
> > > #include <unistd.h>
> > > #ifdef _POSIX_MEMLOCK_RANGE
> > > #include <sys/mman.h>
> > > #endif
> > >
> > > ...
> > >         int e;
> > >
> > > #ifdef _POSIX_MEMLOCK_RANGE
> > >         e = mlockall( MCL_CURRENT|MCL_FUTURE);
> > > #endif
> > >
> > > (Before it drops root privileges.)
> > >
> > > Wrolf Courtney
> > > Donovan Data Systems, Inc.
> > > (212) 633-5470
> > >
> > >
> >
> >
>







To unsubscribe via postal mail, please contact us at:
Jupitermedia Corp.
Attn: Discussion List Management
475 Park Avenue South
New York, NY 10016

Please include the email address which you have been contacted with.

<- Previous Message | Next Message ->
Thread Index

ISP Glossary
Find an ISP Term

Need Help?

JupiterOnlineMedia

internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

Jupitermedia Corporate Info


Legal Notices, Licensing, Reprints, & Permissions, Privacy Policy.

Advertise | Newsletters | Tech Jobs | Shopping | E-mail Offers

Solutions
Whitepapers and eBooks
IBM Whitepaper: Innovative Collaboration to Advance Your Business
Internet.com eBook: Real Life Rails
Avaya Article: Call Control XML - Powerful, Standards-Based Call Control
Tripwire Whitepaper: Seven Practical Steps to Mitigate Virtualization Security Risks
Internet.com eBook: The Pros and Cons of Outsourcing
Go Parallel Article: Scalable Parallelism with Intel(R) Threading Building Blocks
Internet.com eBook: Best Practices for Developing a Web Site
IBM CXO Whitepaper: The 2008 Global CEO Study "The Enterprise of the Future"
Avaya Article: Call Control XML in Action - A CCXML Auto Attendant
Go Parallel Article: James Reinders on the Intel Parallel Studio Beta Program
IBM CXO Whitepaper: Unlocking the DNA of the Adaptable Workforce--The Global Human Capital Study 2008
Adobe Acrobat Connect Pro: Web Conferencing and eLearning Whitepapers
Go Parallel Article: Getting Started with TBB on Windows
HP eBook: Storage Networking , Part 1
MORE WHITEPAPERS, EBOOKS, AND ARTICLES
Webcasts
Go Parallel Video: Intel(R) Threading Building Blocks: A New Method for Threading in C++
HP Video: Is Your Data Center Ready for a Real World Disaster?
Microsoft Partner Portal Video: Microsoft Gold Certified Partners Build Successful Practices
HP On Demand Webcast: Virtualization in Action
Go Parallel Video: Performance and Threading Tools for Game Developers
Rackspace Hosting Center: Customer Videos
Intel vPro Developer Virtual Bootcamp
HP Disaster-Proof Solutions eSeminar
HP On Demand Webcast: Discover the Benefits of Virtualization
MORE WEBCASTS, PODCASTS, AND VIDEOS
Downloads and eKits
Microsoft Download: Silverlight 2 Software Development Kit Beta 2
30-Day Trial: SPAMfighter Exchange Module
Red Gate Download: SQL Toolbelt
Iron Speed Designer Application Generator
Microsoft Download: Silverlight 2 Beta 2 Runtime
MORE DOWNLOADS, EKITS, AND FREE TRIALS
Tutorials and Demos
IBM IT Innovation Article: Green Servers Provide a Competitive Advantage
Microsoft Article: Expression Web 2 for PHP Developers--Simplify Your PHP Applications
Featured Algorithm: Intel Threading Building Blocks - parallel_reduce
MORE TUTORIALS, DEMOS AND STEP-BY-STEP GUIDES