The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
takes time to connect my application Gods_help SUN Solaris 2 11-06-2008 12:10 PM
find command takes a lot of time ( can I skip directories) knijjar Shell Programming and Scripting 3 08-12-2008 08:08 PM
shell script takes long time to complete ozzman Shell Programming and Scripting 12 02-05-2007 11:25 PM
why shell scripting takes more time to read a file brkavi_in Shell Programming and Scripting 1 06-23-2006 08:20 AM
fwrite takes extremely long time inna High Level Programming 5 07-06-2005 06:19 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 06-14-2003
nileshkarania nileshkarania is offline
Registered User
  
 

Join Date: May 2003
Location: Mumbai, India
Posts: 6
Question Writing file to disk takes time

Hi All,
I am working on a Solaris machine. When i use a particular software to generate some files, the log shows around 0 to 3 secs for generating each file. But the same when i see on the disk it shows double the time difference between two file generation.

For example if file A takes 0 secs and file B takes 2 secs and file C takes 2 secs, when i give a ls command the output shows that file A created at 12:00:00
B created at 12:00:08
C created at 12:00:14


Most files generated in 0 secs show 8 seconds and others show double the time.
What could be the problem


Thanks in advance
  #2 (permalink)  
Old 06-14-2003
Perderabo's Avatar
Perderabo Perderabo is offline Forum Staff  
Unix Daemon
  
 

Join Date: Aug 2001
Location: Ashburn, Virginia
Posts: 9,111
ls is showing the last time that the file was written. And I believe in the accuracy of the time it displays. If that does not jibe with the log produced by your "particular software", you should ask the author of that software to explain.
  #3 (permalink)  
Old 06-14-2003
Tux Tux is offline
Registered User
  
 

Join Date: May 2003
Location: UK, Up North
Posts: 113
Doesnt *nix cache writes sometimes to speed up interactvity?
  #4 (permalink)  
Old 06-14-2003
Perderabo's Avatar
Perderabo Perderabo is offline Forum Staff  
Unix Daemon
  
 

Join Date: Aug 2001
Location: Ashburn, Virginia
Posts: 9,111
Quote:
Originally posted by Tux
Doesnt *nix cache writes sometimes to speed up interactvity?
Yes it does, but it still accurately records when the program issued the write(). The data may not find it's way to disk until several secords later. But the inode will record when the write occurred. A record is not kept of when the data was actually synced to disk.
  #5 (permalink)  
Old 06-14-2003
Tux Tux is offline
Registered User
  
 

Join Date: May 2003
Location: UK, Up North
Posts: 113
Okay, I new it was a long shot
  #6 (permalink)  
Old 06-16-2003
nileshkarania nileshkarania is offline
Registered User
  
 

Join Date: May 2003
Location: Mumbai, India
Posts: 6
"The data may not find it's way to disk until several secords later. "
What could be the reason for this???.
  #7 (permalink)  
Old 06-16-2003
Perderabo's Avatar
Perderabo Perderabo is offline Forum Staff  
Unix Daemon
  
 

Join Date: Aug 2001
Location: Ashburn, Virginia
Posts: 9,111
Unix has a buffer cache which is a very large chunk of main memory.

When you issue a disk read, unix sees if the data is already in the buffer cache, if so no i/o occurs, the data is just moved into your program's buffer. When you issue a write, the data is just moved into the buffer cache.

The system periodicly scans the buffer cache and flushes new data to disk. This is called "write-behind". The system also predicts data that you are likely to need and issues reads to get the data into the buffer cache before your program wants it. This is called "read-ahead".

Read-ahead and write-behind work so well that most disk i/o is reduced to just moving data in memory.
Closed Thread

Bookmarks

Tags
solaris

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 11:35 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0