Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7960057
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T04:40:04+00:00 2026-06-04T04:40:04+00:00

I read proc/<pid>/io to measure the IO-activity of SQL-queries, where <pid> is the PID

  • 0

I read proc/<pid>/io to measure the IO-activity of SQL-queries, where <pid> is the PID of the database server. I read the values before and after each query to compute the difference and get the number of bytes the request caused to be read and/or written.

As far as I know the field READ_BYTES counts actual disk-IO, while RCHAR includes more, like reads that could be satisfied by the linux page cache (see Understanding the counters in /proc/[pid]/io for clarification).
This leads to the assumption, that RCHAR should come up with a value equal or greater than READ_BYTES, but my results contradict this assumption.

I could imagine some minor block or page overhead for results I get for Infobright ICE (values are MB):

        Query        RCHAR   READ_BYTES
tpch_q01.sql|    34.44180|    34.89453|
tpch_q02.sql|     2.89191|     3.64453|
tpch_q03.sql|    32.58994|    33.19531|
tpch_q04.sql|    17.78325|    18.27344|

But I completely fail to understand the IO-counters for MonetDB (values are MB):

        Query        RCHAR   READ_BYTES
tpch_q01.sql|     0.07501|   220.58203|
tpch_q02.sql|     1.37840|    18.16016|
tpch_q03.sql|     0.08272|   162.38281|
tpch_q04.sql|     0.06604|    83.25391|

Am I wrong with the assumption that RCHAR includes READ_BYTES? Is there a way to trick out the kernels counters, that MonetDB could use? What is going on here?

I might add, that I clear the page cache and restart the database-server before each query.
I’m on Ubuntu 11.10, running kernel 3.0.0-15-generic.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T04:40:05+00:00Added an answer on June 4, 2026 at 4:40 am

    I can only think of two things:

    http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;f=Documentation/filesystems/proc.txt;hb=HEAD#l1305

    1:

    1446 read_bytes
    1447 ----------
    1448
    1449 I/O counter: bytes read
    1450 Attempt to count the number of bytes which this process really did cause to
    1451 be fetched from the storage layer.
    

    I read “Caused to be fetched from the storage layer” to include readahead, whatever.

    2:

    1411 rchar
    1412 -----
    1413
    1414 I/O counter: chars read
    1415 The number of bytes which this task has caused to be read from storage. This
    1416 is simply the sum of bytes which this process passed to read() and pread().
    1417 It includes things like tty IO and it is unaffected by whether or not actual
    1418 physical disk IO was required (the read might have been satisfied from
    1419 pagecache)
    

    Note that this says nothing about “disk access via memory mapped files”. I think this is the more likely reason, and that your MonetDB probably mmaps out its database files and then does everything on them.

    I’m not really sure how you could check the used bandwidth on mmap, because of its nature.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I try to read file /proc/'pid'/status, using c program. The code is as follows,
I read this already: The Best Way to shred XML data into SQL Server
I've read about the great uses of /proc/<pid>/fd and specifically fdinfo in this article
Converting values read from proc/net/tcp6 0000000000000000FFFF00000100007F to ::ffff:10.200.0.31 I am familiar with converting ipv4
I have really strange behaviour while reading files from /proc If I read /proc/pid/stat
I know I can read off /proc/[id]/maps but I'm not sure if the first
Read about Server push here . I want to push data to client from
Read on before you say this is a duplicate, it's not. (as far as
I'm projecting a monitoring client in Java which will read information from /proc .
I parse data from /proc/[pid]/statm to get a clue about memory usage of a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.