Sponsored Content
Top Forums UNIX for Dummies Questions & Answers ls is taking long time to list Post 302718175 by mercy on Friday 19th of October 2012 09:09:59 AM
Old 10-19-2012
Then you do ls in first time, you read directory desctiptor.
If dir contain maaaaaany file (>10k) - this process is not fast.
In next requests ls use cached directory desctiptor and ls work fast
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

fetchmail taking long time to fetchmail...

Hi peeps, We are having around 60 users. The time set to retrieve the mail is 300 sec. But it's taking around 1 hour to deliver mails. I am using debian sarge 3.1. any clues? And how it will affect if I decrease the time? My machine has got 1 p4 3.0 GHZ processor and 1 GB ram. The home... (2 Replies)
Discussion started by: squid04
2 Replies

2. Red Hat

login process taking a long time

I'm having a bit of a login performance issue.. wondering if anyone has any ideas where I might look. Here's the scenario... Linux Red Hat ES 4 update 5 regardless of where I login from (ssh or on the text console) after providing the password the system seems to pause for between 30... (4 Replies)
Discussion started by: retlaw
4 Replies

3. Shell Programming and Scripting

For Loop Taking Too Long

I'm new from UNIX scripting. Please help. I have about 10,000 files from the $ROOTDIR/scp/inbox/string1 directory to compare with the 50 files from /$ROOTDIR/output/tma/pnt/bad/string1/ directory and it takes about 2 hours plus to complete the for loop. Is there a better way to re-write the... (5 Replies)
Discussion started by: hanie123
5 Replies

4. Shell Programming and Scripting

<AIX>Problem in purge script, taking very very long time to complete 18.30hrs

Hi, I have here a script which is used to purge older files/directories based on defined purge period. The script consists of 45 find commands, where each command will need to traverse through more than a million directories. Therefore a single find command executes around 22-25 mins... (7 Replies)
Discussion started by: sravicha
7 Replies

5. UNIX for Dummies Questions & Answers

gref -f taking long time for big file

grep -f taking long time to compare for big files, any alternate for fast check I am using grep -f file1 file2 to check - to ckeck dups/common rows prsents. But my files contains file1 contains 5gb and file 2 contains 50 mb and its taking such a long time to compare the files. Do we have any... (10 Replies)
Discussion started by: gkskumar
10 Replies

6. UNIX for Dummies Questions & Answers

Job is taking long time

Hi , We have 20 jobs are scheduled. In that one of our job is taking long time ,it's not completing. If we are not terminating it's running infinity time actually the job completion time is 5 minutes. The job is deleting some records from the table and two insert statements and one select... (7 Replies)
Discussion started by: ajaykumarkona
7 Replies

7. Solaris

How to find out bottleneck if system is taking long time in gzip

Dear All, OS = Solaris 5.10 Hardware Sun Fire T2000 with 1 Ghz quode core We have oracle application 11i with 10g database. When ever i am trying to take cold backup of database with 55GB size its taking long time to finish. As the application is down nobody is using the server at all... (8 Replies)
Discussion started by: yoojamu
8 Replies

8. Shell Programming and Scripting

While loop problem taking too long

while read myhosts do while read discovered do echo "$discovered" done < $LOGFILE | grep -Pi "|" | egrep... (7 Replies)
Discussion started by: SkySmart
7 Replies

9. Shell Programming and Scripting

Long list file display different time format.

Hi Gurus, I have some weird issue. when using ls -l the result shows different time format: -rw-r--r-- 1 abc gourp1 3032605576 Jun 14 2013 abc -rw-rw-r-- 1 abc gourp1 1689948832 Aug 10 06:22 abc one display 2013 which is year; another one displays 06:22 which is time. ... (4 Replies)
Discussion started by: ken6503
4 Replies

10. Shell Programming and Scripting

Rm -rf is taking very long, will it timeout?

I have so many (hundreds of thousands) files and directories within this one specific directory that my "rm -rf" command to delete them has been taking forever. I did this via the SSH, my question is: if my SSH connection times out before rm -rf finishes, will it continue to delete all of those... (5 Replies)
Discussion started by: phpchick
5 Replies
RateLimiter(3pm)					User Contributed Perl Documentation					  RateLimiter(3pm)

NAME
Schedule::RateLimiter - prevent events from happening too quickly. SYNOPSIS
use Schedule::RateLimiter; # Don't let this event happen more than 5 times in a 60 second period. my $throttle = Schedule::RateLimiter->new ( iterations => 5, seconds => 60 ); # Cycle forever, but not too fast. while ( 1 ) { $throttle->event(); &do_something; } DESCRIPTION
This module provides a way to voluntarily restrict how many times a given action may take place within a specified time frame. Such a tool may be useful if you have written something which periodically polls some public resource and want to ensure that you do not overburden that resource with too many requests. Initially, one might think that solving this problem would be as simple as sleeping for the number of seconds divided by the number of iterations in between each event. However, that would only be correct if the event took no time at all. If you know exactly how much time each event is going to take then you could build an even more complicated one-liner such as this: sleep( (seconds / iterations) - single_event_time ) This module is intended to address the other cases when the exact run-time of each event is unknown and variable. This module will try very hard to allow an event to happen as many times as possible without exceeding the specified bounds. For example, suppose you want to write something that checks an 'incoming' directory once a minute for files and then does something with those files if it finds any. If it takes you two seconds to process those files, then you want to wait 58 seconds before polling the directory again. If it takes 30 seconds to process those files, then you only want to wait 30 seconds. And if it takes 3 minutes, then you want to poll the directory again immediately as soon as you are done. my $throttle = Schedule::RateLimiter->new ( seconds => 60 ); &poll_and_process while ( $throttle->event ); METHODS
" new() " Creates and returns a new Schedule::RateLimiter object. The constructor takes up to three parameters: o block (default: true) This parameter accepts a true or false value to set the default "block" behavior on future calls to event(). It makes it more convenient to turn blocking off for an entire object at a time. o iterations (default: 1) This specifies the number of times an event may take place within the given time period. This must be a positive, non-zero integer. o seconds (required) This specifies the minimum number of seconds that must transpire before we will allow (iterations + 1) events to happen. A value of 0 disables throttling. You may specify fractional time periods. example: my $throttle = Schedule::RateLimiter->new ( iterations => 2, seconds => 10 ); # Event 1 $throttle->event(); # Event 2 $throttle->event(); # Event 3 $throttle->event(); # 10 seconds will have transpired since event 1 at this point. # Event 4 $throttle->event(); # 10 seconds will have transpired since event 2 at this point. " event() " Called to signal the beginning of an event. This method will return true or false to indicate if it is ok to proceed with the event. This method uses Time::HiRes to do its calculations and sleeping, so the precision of this method will be the same as the precision of Time::HiRes on your platform. Takes one (optional) parameter: o block (default: true) If set to a false value, this method will do a non-blocking check to see if it is ok for the event to occur. If it is not ok, this method will return a false value and assume that the event did not take place. Otherwise, this method will return a true value and assume that the event did take place. example: # Stop when the code moves too fast. while ( 1 ) { if ($throttle->event( block => 0 )) { &do_something; } else { die 'I went too fast!'; } } BUGS
This module needs to keep a record of when every iteration took place, so if you are allowing a large number of iterations to happen in the given time period, this could potentially use a lot of memory. KNOWN ISSUES
If you have multiple iterations that typically happen very quickly, and you want to limit them in a long period of time, they will "clump" together. That is, they all happen at just about the same time, and then the system waits for a long period before doing the same "clump" again. That's just the nature of the best-fit algorithm. Anything that is done to try to separate single events with longer waits than necessary will potentially create a sub-optimal situation if an event in the future takes longer than expected. If you really want all of your events to start at even time periods apart from each other, then set the number of iterations to 1 and adjust the number of seconds accordingly. AUTHOR
Daniel J. Wright, <wright@pair.com> SEE ALSO
The POE module provides a more heavyweight solution to this problem as well. perl. perl v5.10.0 2003-12-04 RateLimiter(3pm)
All times are GMT -4. The time now is 07:55 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy