How to reduce max buffer/cache size?

Hi,
every time I copy a file which is bigger or similiar in size to my total RAM (4gb) I notice very low responsibility from firefox (which is totally unresponsive, can't switch tabs or scroll for 30-60s). Of course my free memory is very low (something like 50-100mb) and I notice some swap usage. AFAIK linux caches everthing that is being copied, but in case of such big files it seems unnecessary.
Is there a way to reduce max buffer size?
I know that buffering is good in general, but I get a feeling that firefox is giving up ram and he has to read everything again from disk which slows him down. I always have many tabs open, so often it has around 30% of memory.
I searched many times on how to reduce buffer sizes, but I've always found only articles with "buffering is always good and never an issue" attitude.
I would be very happy to hear any suggestrions,
cheers,
kajman

This seems a popular problem, going back years. The default Linux setup is bad for responsiveness, it seems.
Here's the summary of what I do:
Firstly, install a BFS-patched kernel, for a better kernel scheduler, and also so that the ionice and schedtool commands will work. Bonus points for switching to BFQ while you're at it - or stick with CFQ, which also supports ionice.
In /etc/fstab, use commit=60 rather than default of 5 seconds, and also noatime, e.g.:
UUID=73d55f23-fb9d-4a36-bb25-blahblah / ext4 defaults,noatime,nobarrier,commit=60 1 1
In /etc/sysctl.conf
# From http://rudd-o.com/en/linux-and-free-software/tales-from-responsivenessland-why-linux-feels-slow-and-how-to-fix-that
vm.swappiness=0
# https://lwn.net/Articles/572921/
vm.dirty_background_bytes=16777216
vm.dirty_bytes=50331648
In ~/.bashrc - see post, e.g.:
alias verynice="ionice -c3 nice -n 15"
In /etc/security/limits.d/ - see post. Read CK's excellent blog article, for info.
In your cp command, add the word verynice to the start, to stop the large batch copy from having the same priority as your UI.
Compile sqlite without fsync, to make e.g. firefox smoother.
Potentially use threadirqs to prioritize the interrupt-handling.
Edit: Updated vm.swappiness from 0 to 10, from CK's blog.
Edit2: Also see patch and e.g. nr_requests in thread.
Edit3: Using nice instead of schedtool - not sure whether schedtool can hog the CPU.
Edit4: Added threadirqs.
Edit5: Tweaked sysctl.conf settings.
Edit6: Added nobarrier option to mount, and sqlite's fsync.
Edit7: Removed swap comment - I do use a swapfile, these days, mainly because firefox needs so much virtual RAM to compile.
Last edited by brebs (2014-03-10 09:51:34)

Similar Messages

  • Determining buffer cache size

    Hello,
    I'd like to get the type of information in version 8 that I can get in version 9 through v$db_cache_advice in order to determine the size that the buffer cache should be. I've found sites that say you can set db_block_lru_extended_statistics to populate v$recent_bucket, but they say there is a performance hit. Can anyone tell me qualitatively how much of a performance hit this causes (obviously it would only be run this way for a short period of time), and whether or not this is really the best/right way to do this?
    Thanks.

    Actually ours is bank Database,
    Our Database size is 400GB.
    last month they got ORA-000604 error,
    so that production database got hanged for 15 min, issue got resolved automatically after 15min.
    At that time complete buffer cache was flushed out & all oracle Processes was terminated.
    becoz of that they increased buffer cache size.

  • Oracle buffer cache size

    I need to calculate buffer cache size calculation for get operation.
    SELECT o.object_name, h.status, count(*) number_of_blockes
    FROM V$BH h, DBA_OBJECTS o WHERE h.objd=o.data_object_id
    AND o.owner NOT IN('SYS','SYSTEM','SYSMAN')
    AND h.status NOT IN('free')
    GROUP BY o.object_name,h.status
    ORDER BY count(*) DESC;
    Used the above query, so i got the number of blocks used to cache data.
    I performed a get operation in one db and number of blocks noticed.
    But the problem is same operation in another db shows different number of blocks.
    Both db are same configuration.
    Anyone notices this issue??

    Why do you expect them to be the same?
    Oracle version of each database?
    Number of objects in each database?
    Size of buffer cache in each database?
    The amount of query activity that would actually load blocks into the buffer cache in each database is not likely to be "the same".
    Identical data can take up a different number of blocks in different databases, depending on how it was loaded, transactions on that data, etc, so the number of blocks used in the buffer cache is likely to be different in different databases, even for the same data set.

  • Suggest buffer cache size check

    Hi experts,
    please suggest how much give size of buffer cache. please tell me how to calculate this.
    Note: on database running huge select with where clause.
    >
    SQL> show sga
    Total System Global Area 536870912 bytes
    Fixed Size 1220408 bytes
    Variable Size 117440712 bytes
    Database Buffers 411041792 bytes
    Redo Buffers 7168000 bytes
    >
    >
    SGA_ADVISORE
    SQL> column c1 heading 'Cache Size (m)' format 999,999,999,999
    SQL> column c2 heading 'Buffers' format 999,999,999
    SQL> column c3 heading 'Estd Phys|Read Factor' format 999.90
    SQL> column c4 heading 'Estd Phys| Reads' format 999,999,999,999
    SQL>
    SQL> select
    2 size_for_estimate c1,
    3 buffers_for_estimate c2,
    estd_physical_read_factor c3,
    4 5 estd_physical_reads c4
    6 from
    7 v$db_cache_advice
    8 where
    9 name = 'DEFAULT'
    10 and
    11 block_size = (SELECT value FROM V$PARAMETER
    12 WHERE name = 'db_block_size')
    and
    13 14 advice_status = 'ON';
    Estd Phys Estd Phys
    Cache Size (m) Buffers Read Factor Reads
    36 4,491 1.02 1,768,088,631
    72 8,982 1.01 1,751,858,036
    108 13,473 1.01 1,745,807,886
    144 17,964 1.00 1,742,684,545
    180 22,455 1.00 1,740,606,287
    216 26,946 1.00 1,739,127,030
    252 31,437 1.00 1,737,935,545
    288 35,928 1.00 1,736,936,513
    324 40,419 1.00 1,736,098,119
    360 44,910 1.00 1,735,368,624
    Estd Phys Estd Phys
    Cache Size (m) Buffers Read Factor Reads
    392 48,902 1.00 1,734,775,608
    396 49,401 1.00 1,734,701,493
    432 53,892 1.00 1,734,086,804
    468 58,383 1.00 1,733,466,505
    504 62,874 1.00 1,732,871,083
    540 67,365 1.00 1,732,300,725
    576 71,856 1.00 1,731,737,930
    612 76,347 1.00 1,731,204,779
    648 80,838 1.00 1,730,669,455
    684 85,329 1.00 1,730,117,349
    Estd Phys Estd Phys
    Cache Size (m) Buffers Read Factor Reads
    720 89,820 .98 1,703,583,925
    21 rows selected.
    Dictionary Cache Hit Ratio : 99.92% Value Acceptable.
    Library Cache Hit Ratio : 98.22% Increase SHARED_POOL_SIZE parameter to bring value above 99%
    DB Block Buffer Cache Hit Ratio : 60.53% Increase DB_BLOCK_BUFFERS parameter to bring value above 89%
    Latch Hit Ratio : 99.72% Value acceptable.
    Disk Sort Ratio : 0.00% Value Acceptable.
    Rollback Segment Waits : 0.00% Value acceptable.
    Dispatcher Workload : 0.00% Value acceptable.
    >
    Edited by: 928992 on Oct 18, 2012 2:31 PM
    Edited by: 928992 on Oct 18, 2012 3:04 PM

    I am displaying you mine test db's buffer cache size : (11.2.0.1 on Windows box)
    SQL> show parameter db_cache_size;
    NAME                                 TYPE        VALUE
    db_cache_size                        big integer 0
    SQL> select name, current_size, buffers, prev_size, prev_buffers from v$buffer_pool;
    NAME                 CURRENT_SIZE    BUFFERS  PREV_SIZE PREV_BUFFERS
    DEFAULT                       640      78800          0            0
    SQL> select name,bytes from v$sgainfo where name='Buffer Cache Size';
    NAME                                  BYTES
    Buffer Cache Size                 *671088640*
    SQL> show sga;
    Total System Global Area 1603411968 bytes
    Fixed Size                  2176168 bytes
    Variable Size             922749784 bytes
    *Database Buffers          671088640 bytes*
    Redo Buffers                7397376 bytes
    SQL> select * from v$sga;
    NAME                      VALUE
    Fixed Size              2176168
    Variable Size         922749784
    *Database Buffers      671088640*
    Redo Buffers            7397376
    SQL> show parameter sga_target;
    NAME                                 TYPE        VALUE
    sga_target                           big integer 0
    SQL>Regards
    Girish Sharma
    Edited by: Girish Sharma on Oct 18, 2012 2:51 PM
    Oracle and OS Info added.

  • Buffer cache size

    Hi there,
    Can anyone explain these results on a 10.2.0.1 database?
    SQL> select name, bytes/1024/1024 from v$sgainfo where name='Buffer Cache Size';
    NAME BYTES/1024/1024
    Buffer Cache Size 1728
    SQL> show parameter db_cache_size
    NAME TYPE VALUE
    db_cache_size big integer 768M
    NAME TYPE VALUE
    sga_target big integer 0
    As you can see AMM is disabled (sga_target=0), however v$sgainfo and dba_hist_sga record always a buffer cache size of 1728 MB and db_cache_size is set to 768 MB.
    How can it be?
    Many thanks.

    I answer myself:
    db_8k_cache_size big integer 160M
    db_cache_size big integer 768M
    db_keep_cache_size big integer 400M
    db_recycle_cache_size big integer 400M
    I am like a newbee...

  • 10G NEW FEATURE-HOW TO FLUSH THE BUFFER CACHE

    제품 : ORACLE SERVER
    작성날짜 : 2004-05-25
    10G NEW FEATURE-HOW TO FLUSH THE BUFFER CACHE
    ===============================================
    PURPOSE
    이 자료는 Oracle 10g new feature 로 manual 하게
    buffer cache 를 flush 할 수 있는 기능에 대하여 알아보도록 한다.
    Explanation
    Oracle 10g 에서 new feature 로 소개된 내용으로 SGA 내 buffer cache 의
    모든 data 를 command 수행으로 clear 할 수 있다.
    이 작업을 위해서는 "alter system" privileges 가 있어야 한다.
    Buffer cache flush 를 위한 command 는 다음과 같다.
    주의) 이 작업은 database performance 에 영향을 줄 수 있으므로 주의하여 사용하여야 한다.
    SQL > alter system flush buffer_cache;
    Example
    x$bh 를 query 하여 buffer cache 내 존재하는 정보를 확인한다.
    x$bh view 는 buffer cache headers 정보를 확인할 수 있는 view 이다.
    우선 test 로 table 을 생성하고 insert 를 수행하고
    x$bh 에서 barfil column(Relative file number of block) 과 file# 를 조회한다.
    1) Test table 생성
    SQL> Create table Test_buffer (a number)
    2 tablespace USERS;
    Table created.
    2) Test table 에 insert
    SQL> begin
    2 for i in 1..1000
    3 loop
    4 insert into test_buffer values (i);
    5 end loop;
    6 commit;
    7 end;
    8 /
    PL/SQL procedure successfully completed.
    3) Object_id 확인
    SQL> select OBJECT_id from dba_objects
    2 where object_name='TEST_BUFFER';
    OBJECT_ID
    42817
    4) x$bh 에서 buffer cache 내에 올라와 있는 DBARFIL(file number of block) 를 조회한다.
    SQL> select ts#,file#,dbarfil,dbablk,class,state,mode_held,obj
    2 from x$bh where obj= 42817;
    TS# FILE# DBARFIL DBABLK CLASS STATE MODE_HELD J
    9 23 23 1297 8 1 0 7
    9 23 23 1298 9 1 0 7
    9 23 23 1299 4 1 0 7
    9 23 23 1300 1 1 0 7
    9 23 23 1301 1 1 0 7
    9 23 23 1302 1 1 0 7
    9 23 23 1303 1 1 0 7
    9 23 23 1304 1 1 0 7
    8 rows selected.
    5) 다음과 같이 buffer cache 를 flush 하고 위 query 를 재수행한다.
    SQL > alter system flush buffer_cache ;
    SQL> select ts#,file#,dbarfil,dbablk,class,state,mode_held,obj
    2 from x$bh where obj= 42817;
    6) x$bh 에서 state column 이 0 인지 확인한다.
    0 은 free buffer 를 의미한다. flush 이후에 state 가 0 인지 확인함으로써
    flushing 이 command 를 통해 manual 하게 수행되었음을 확인할 수 있다.
    Reference Documents
    <NOTE. 251326.1>

    I am also having the same issue. Can this be addressed or does BEA provide 'almost'
    working code for the bargin price of $80k/cpu?
    "Prashanth " <[email protected]> wrote:
    >
    Hi ALL,
    I am using wl:cache tag for caching purpose. My reqmnt is such that I
    have to
    flush the cache based on user activity.
    I have tried all the combinations, but could not achieve the desired
    result.
    Can somebody guide me on how can we flush the cache??
    TIA, Prashanth Bhat.

  • How to reduce oracle DB's size?

    Hi,All
    After upgrading NW7.0 to NW7.0 EHP1, the oracle's changed from 37GB to 70GB, How to reduce the DB's size?
    Thanks.
    Best regards
    Jiande Ding

    Hi,
    1.From DB02--> detail analysis menu you can take out top 50 tables & indexes. you can mark the size of the index should be generally less than the table.If its more or very much similar size of table, you can rebuild it using SE14. This can free some space.
    or else you may use brspace to do this.
    http://help.sap.com/saphelp_nw70/helpdata/EN/58/6bec38c9fa7e44b7f2163905863575/frameset.htm
    In case of table this option is risky as it may result in data loss.
    2. Earlywatch alert gives the top 20 degenrated index. you can check that which also gives a factor 'storage quality'.
    3. Run report SAP_DROP_TMPTABLES. It removes temporary database objects. ( we do this in our BW system)
    Hope this helps
    Thanks
    Sushil

  • How to reduce illustrator CS4 file size

    Hi,
    How to reduce illustrator CS4 file size, the file size is alots bigger compare to art work done in indesign?

    Hi
    Please follow this video tutorial and you will see a small thing can reduce the file size easily. It was really helpfull for me.
    How to Reduce AI Vector file size: An Adobe illustrator Tutorial
    http://www.youtube.com/watch?v=X5m3TKrXE3g
    My AI file size was not going under 1 MB even by deleting extras so what I did is I opened a raster small image of 100 kb with Adobe Illustrator. then deleted the image and saved the file as AI. Then I Copied the whole vector content of original AI file that was bigger then 1 MB with ctrl+c command and pasted it in the new file created with raster image. and saved it. Wow the new file size is only 137 kb now.
    Thanks

  • Swapping and Database Buffer Cache size

    I've read that setting the database buffer cache size too large can cause swapping and paging. Why is this the case? More memory for sql data would seem to not be a problem. Unless it is the proportion of the database buffer to the rest of the SGA that matters.

    Well I am always a defender of the large DB buffer cache. Setting the bigger db buffer cache alone will not in any way hurt Oracle performance.
    However ... as the buffer cache grows, the time to determine 'which blocks
    need to be cleaned' increases. Therefore, at a certain point the benefit of a
    larger cache is offset by the time to keep it sync'd to the disk. After that point,
    increasing buffer cache size can actually hurt performance. That's the reason why Oracle has checkpoint.
    A checkpoint performs the following three operations:
    1. Every dirty block in the buffer cache is written to the data files. That is, it synchronizes the datablocks in the buffer cache with the datafiles on disk.
    It's the DBWR that writes all modified databaseblocks back to the datafiles.
    2. The latest SCN is written (updated) into the datafile header.
    3. The latest SCN is also written to the controlfiles.
    The following events trigger a checkpoint.
    1. Redo log switch
    2. LOG_CHECKPOINT_TIMEOUT has expired
    3. LOG_CHECKPOINT_INTERVAL has been reached
    4. DBA requires so (alter system checkpoint)

  • How to reduce a PDF file size under Adobe Acrobat Reader DC. The size is now 23MB; I need it to be less than 4MB. thanks

    how to reduce a PDF file size under Adobe Acrobat Reader DC. The size is now 23MB; I need it to be less than 4MB. thanks

    I've found in Pdf's many time when you go to Optimize a PDF and look at the font list there are often up to a 1/2dozen copies of a given font, say Helvetica, then that many Helvetica Bold, or Arial or Ariel Italic
    What I do ie remove from list all but one copy of each different font. often dramatically reduces the size. also something lese is Flattening images will in some cases reduce a file size. I have run into a case where it actually made a PDF Larger.

  • Does buffer cache size matters during imp process ?

    Hi,
    sorry for maybe naive question but I cant imagine why do Oracle need buffer cache (larger = better ) during inserts only (imp process with no index creation) .
    As far as I know insert is done via pga area (direct insert) .
    Please clarify for me .
    DB is 10.2.0.3 if that matters :).
    Regards.
    Greg

    Surprising result: I tried closing the db handles with DB_NOSYNC and performance
    got worse. Using a 32 Meg cache, it took about twice as long to run my test:
    15800 seconds using DB->close(DB_NOSYNC) vs 8200 seconds using DB->close(0).
    Here is some data from db_stat -m when using DB_NOSYNC:
    40MB 1KB 900B Total cache size
    1 Number of caches
    1 Maximum number of caches
    40MB 8KB Pool individual cache size
    0 Maximum memory-mapped file size
    0 Maximum open file descriptors
    0 Maximum sequential buffer writes
    0 Sleep after writing maximum sequential buffers
    0 Requested pages mapped into the process' address space
    26M Requested pages found in the cache (70%)
    10M Requested pages not found in the cache (10811882)
    44864 Pages created in the cache
    10M Pages read into the cache (10798480)
    7380761 Pages written from the cache to the backing file
    3452500 Clean pages forced from the cache
    7380761 Dirty pages forced from the cache
    0 Dirty pages written by trickle-sync thread
    10012 Current total page count
    5001 Current clean page count
    5011 Current dirty page count
    4099 Number of hash buckets used for page location
    47M Total number of times hash chains searched for a page (47428268)
    13 The longest hash chain searched for a page
    118M Total number of hash chain entries checked for page (118169805)
    It looks like not flushing the cache regularly is forcing a lot more
    dirty pages (and fewer clean pages) from the cache. Forcing a
    dirty page out is slower than forcing a clean page out, of course.
    Is this result reasonable?
    I suppose I could try to sync less often than I have been, but more often
    than never to see if that makes any difference.
    When I close or sync one db handle, I assume it flushes only that portion
    of the dbenv's cache, not the entire cache, right? Is there an API I can
    call that would sync the entire dbenv cache (besides closing the dbenv)?
    Are there any other suggestions?
    Thanks,
    Eric

  • How do I Change the Cache size?

    I have an iBook G4 and am trying to change the cache size for this screen saver I downloaded.
    iBook G4   Mac OS X (10.4.9)  

    Hi
    Curious which screensaver you are referring to?
    Screensavers can be processor intensive, requiring a certain level of computing power to avoid flicker or stuttering. The G4 iBook is not that type of machine.
    Some Screen Savers have a preference file (accessed through the Desktop and Screen Saver System Pref Panel - highlight the saver, and select "options" if one is available) where you can adjust the operating speeds and other parameters. Otherwise, I don't believe there is anything more you can do.
    I notice a big difference in certain screen savers running on my G5 iMac vs. my iBook, with the former handling the screen movement much more easily.
    Post back
    iMac G5 Rev C 20" 2.5gb RAM 250 gb HD/iBook G4 1.33 ghz 1.5gb RAM 40 gb HD   Mac OS X (10.4.9)   Seagate 300 gb ext. HD Canon i960 printer, Airport Express (2 units)

  • How to reduce image's file size in Preview?

    I am in Preview Version 5.0.3 (504.1).  I have a PDF file that is 3.7 meg. in size.  That is a big large for what I want to do with it.  I would like to reduce its size to something a bit more manageable.   The Preview Help gives these instructions:
    To reduce an image’s file size without changing its dimensions:
    Choose Tools > Adjust Size.
    Select “Resample image.”
    Enter a smaller value in the Resolution field.
    My problem is that in my open window for this file the "Adjust Size" tool is dimmed.  I cannot choose that tool as instructed.  
    Does anyone know why and how to get Preview to reduce the size of a PDF file?

    try File-Save As...
    & choose format:pdf    quartz filter:reduce file size
    pick another name to check the results - there's no undo

  • How to reduce PDF Form file size?

    Hello
    I have a PDF that is 22KB without form fields, but once I add the fields to the form, it increases the size to a huge 528KB.
    There are 5 or so text fields, one digital signature, and 14 different 'Radio Button" categories.
    Is there any way to still ensure the form works as I need it too (ie. I don't want to get rid of any fields, and I don't want to change radio buttons to check boxes or anything), but reducing the size of the file??
    Thank you

    Are you using any font's other than the standard ones (aka base-14)? The standard ones are Helvetica, Times, Courier (including four variants of each), Symbol, and Zapf Dingbats (Adobe Pi is the replacement).
    If that's not it, do a Save As, as opposed to just a Save. This will rid the document of unused objects that accumulate each time you save.

  • How to reduce/increase search webpart size

    How to change the size of the search webpart. When modyfying the webpart, there are two options for defining the height and width of the webpart, but when changing those porameters, only the zone size increases..the webpart size remains the same.. is there a way to change the size of the webpart..(increase or decrease the size of the webpart?)
    Thanks in advance..

    Moving to Design/Customization as the fact this is a *search* web part seems less relevant than the fact you want to change the size.WSS FAQ sites: http://wssv2faq.mindsharp.com and http://wssv3faq.mindsharp.com
    Total list of WSS 3.0 / MOSS 2007 Books (including foreign language) http://wssv3faq.mindsharp.com/Lists/v3%20WSS%20FAQ/V%20Books.aspx

Maybe you are looking for

  • How can I get my blackberry curve 8900 to update to 5.0 and get wifi to work?

    I bought a blackberry curve 8900 around a year ago on an AT&T plan back when data plans werent required, so it just has minutes and texting. because of an issue i had with data before, i have data disabled completely on my account to prevent any mist

  • Can I attach an external monitor to my iMac G5 (ALS) if the video card is dead?

    I don't know for a fact that the video card is dead, but the screen on my iMac (PPC/ALS) 20" gradually started flaking out over several months and is now dead. Computer boots up fine and I'm looking at it through target mode right now.  I want to kee

  • I need a software cd for webcam III

    can someone help me with a software cd for a webcam III (creative) PLZZZ :womansad:

  • Error displaying jsp page

    hi everybody, I get this error when i try to display a jsp page: type Exception report message description The server encountered an internal error () that prevented it from fulfilling this request. exception org.apache.jasper.JasperException: Except

  • Create commisson agent partner function

    Hi, I have ascenario where in we need to have a commisson agent partner function in the sales order. The agent shall be paid a fixed quantity per UOM of the finished product. This necessarily should be copied to the delivery and billing documents. Th