Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
If you insist on doing this in this way, I would use directory trees to store the login count, meaning for the ip 127.0.0.1 use  /var/run/iptracker/127/0/0/1/count this will make the application run much faster than storing a huge number of files in one directory. when you get above a certain number of files in a directory (it differs on platform/version) you will see a _HUGE_ slowdown when stating files and opening files in said directory. I would recommend using some type of database or tie hash to store this instead. You get one file with quick lookups and no messy filesystem cleanups to worry about. Also 127.0.0.1 is a proper IP address.


-Waswas


Edited to add: I agree with ovid that IP/failed login pairing not a very good metric for taking action. Many ISP's are claiming "Speed enhancers" nowadays which is really just a transparent proxy farm set up to grab a page, reduce image size/quality and push on to the requester. So more often than ever your site will be hit by proxy servers -- taking action based on IP is not worthwhile. One of the only things I can see being useful in that arena is to maybe take a rolling average of badauths/ip/time to throttle an attack from a source ip. But even that is hard to do without penalizing good users.

In reply to Re: create filename from IP# by waswas-fng
in thread create filename from IP# by belize

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (4)
As of 2024-04-20 16:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found