One thing I've noticed, is that while there's been lots of talk, over the years, about minimum swap partition size, I don't recall seeing mention of a maximum size. For example, 32 bit CPUs have a maximum addressing range of 4 GB. Since swap is the virtual memory area, does this mean that it's also limited to 4 GB? If so, does that mean that the 64 bit CPUs can have a swap partition(s) of up to 16 exabytes? tnx jk
James, On Sunday 06 March 2005 05:07, James Knott wrote:
One thing I've noticed, is that while there's been lots of talk, over the years, about minimum swap partition size, I don't recall seeing mention of a maximum size. For example, 32 bit CPUs have a maximum addressing range of 4 GB.
That is the maximum conceivable _virtual_ address space. Each process has its own, so if you wanted to make sure that no process was limited by available virtual memory (physical + swap), you'd need the maximum (which is less than 4 GB because of reserved areas of the virtual space) times the number of concurrently executing processes you want to run. This approach to swap space sizing would yield a grossly excessive amount of swap space, of course.
Since swap is the virtual memory area, does this mean that it's also limited to 4 GB? If so, does that mean that the 64 bit CPUs can have a swap partition(s) of up to 16 exabytes?
The same analysis applies to 64-bit architectures. If you're actually going to be running programs that use the larger virtual address space of a 64-bit architecture, you'd want to get more physical memory and possibly configure more swap space, too. But keep in mind, your system will be pretty much unusable whenever the working set size (the amount of memory system-wide that is being actively accessed) gets much bigger than the available (non-kernel) physical memory. When that happens, paging activity increases sharply while CPU utilization drops because processes are spending most of their time waiting for their virtual memory contents to be paged in.
tnx jk
Randall Schulz
The Sunday 2005-03-06 at 07:51 -0800, Randall R Schulz wrote:
But keep in mind, your system will be pretty much unusable whenever the working set size (the amount of memory system-wide that is being actively accessed) gets much bigger than the available (non-kernel) physical memory. When that happens, paging activity increases sharply while CPU utilization drops because processes are spending most of their time waiting for their virtual memory contents to be paged in.
He, he... I have a P-130 machine here with 32 MB and 787060K swap space... I had to do that because the YOU module in suse 7.3 had a bigish memory leak. -- Cheers, Carlos Robinson
On Sun, 2005-03-06 at 14:07, James Knott wrote:
One thing I've noticed, is that while there's been lots of talk, over the years, about minimum swap partition size, I don't recall seeing mention of a maximum size. For example, 32 bit CPUs have a maximum addressing range of 4 GB. Since swap is the virtual memory area, does this mean that it's also limited to 4 GB? If so, does that mean that the 64 bit CPUs can have a swap partition(s) of up to 16 exabytes?
tnx jk
HI, There used to be, a max size of a single swap-area chunk. Afaik, it was 128MB, kernels 1.x or so (so long, long time ago) Had to define two or four area's... But what's the point? Can't define swapspace larger than a free partition on your drive, and if you have partitions upto or larger that 16EB, i'll like to know the name of the hardware supplier. Anyway, if you have need for such a swap-space, i think you have other worries... Not? Hans
Hans Witvliet wrote:
There used to be, a max size of a single swap-area chunk. Afaik, it was 128MB, kernels 1.x or so (so long, long time ago) Had to define two or four area's...
But what's the point? Can't define swapspace larger than a free partition on your drive, and if you have partitions upto or larger that 16EB, i'll like to know the name of the hardware supplier.
Anyway, if you have need for such a swap-space, i think you have other worries... Not?
This was more of a curiousity type question. Also, IIRC, you can have multiple swap partitions, so terabyte swap space is now a possibility, though I'd imagine exabyte swap is still a while away. Incidentally, it wasn't all that long ago, that a fried was bragging that he had a total (4 or 5 drives) of 1 GB disk space on his OS/2 system!
On Sun, Mar 06, 2005 at 01:44:35PM -0500, James Knott wrote:
Hans Witvliet wrote:
There used to be, a max size of a single swap-area chunk. Afaik, it was 128MB, kernels 1.x or so (so long, long time ago) Had to define two or four area's...
But what's the point? Can't define swapspace larger than a free partition on your drive, and if you have partitions upto or larger that 16EB, i'll like to know the name of the hardware supplier.
I can't even imagine a use for that much of a Swap.... RAM, sure, but Swap? No.
Anyway, if you have need for such a swap-space, i think you have other worries... Not?
This was more of a curiousity type question. Also, IIRC, you can have multiple swap partitions, so terabyte swap space is now a possibility, though I'd imagine exabyte swap is still a while away.
Not economical though, RAM would be more....useful. Swap is slow but great for when you're low on RAM.... But if you can afford that much disk space, I don't think you'd have problems affording RAM either in the first place.
Incidentally, it wasn't all that long ago, that a fried was bragging that he had a total (4 or 5 drives) of 1 GB disk space on his OS/2 system!
All that wasted on OS/2?
-- Check the headers for your unsubscription address For additional commands send e-mail to suse-linux-e-help@suse.com Also check the archives at http://lists.suse.com Please read the FAQs: suse-linux-e-faq@suse.com
On Sun, 2005-03-06 at 19:44, James Knott wrote:
This was more of a curiousity type question. Also, IIRC, you can have multiple swap partitions, so terabyte swap space is now a possibility, though I'd imagine exabyte swap is still a while away.
Incidentally, it wasn't all that long ago, that a fried was bragging that he had a total (4 or 5 drives) of 1 GB disk space on his OS/2 system!
I allready though so, For most "normal" situations, sysadmins consider swap nowadays more as a protection meganism against kernel panics. Used to be different. I recall the days (on a dec vax/vms 780) and several hundred people working on it, and on piek moments during the week, most of us were watching which users were swapped out ;-)) At that time "swapped/paged-out" was a fact of life. But since then, CPU, cache and mem-speed have rissen 1000-fold; while "background" -memory, or disks in general perhaps 10 or 20-fold. So the effect of a process being swapped out of main-memory is felt much more. At the HP-UX training classes we were told if a system was using swap intens and for a longer period, one should prepare for several things: -Complaining users (bad system response) -Looking for bad code -Start procedures for buying additional memory So over-commiting your memory (thus swapping) is something to avoid at all costs. Only perfect sense for swapping a processes on purpose, might be in a cluster environment, to re-distribute cpu-load.... But that's getting OT... Hans
On Sunday 06 March 2005 23:10, Hans Witvliet wrote:
I allready though so, For most "normal" situations, sysadmins consider swap nowadays more as a protection meganism against kernel panics.
Used to be different. I recall the days (on a dec vax/vms 780) and several hundred people working on it, and on piek moments during the week, most of us were watching which users were swapped out ;-)) At that time "swapped/paged-out" was a fact of life. But since then, CPU, cache and mem-speed have rissen 1000-fold; while "background" -memory, or disks in general perhaps 10 or 20-fold. So the effect of a process being swapped out of main-memory is felt much more.
At the HP-UX training classes we were told if a system was using swap intens and for a longer period, one should prepare for several things: -Complaining users (bad system response) -Looking for bad code -Start procedures for buying additional memory
So over-commiting your memory (thus swapping) is something to avoid at all costs.
Only perfect sense for swapping a processes on purpose, might be in a cluster environment, to re-distribute cpu-load....
Swapping has other uses. Swapping rarely used data from main internal memory to free up space for disk cache and read-ahead buffers can improve performance. This is why you can sometimes see swap usage even though you have a gigabyte free.
Anders Johansson wrote:
On Sunday 06 March 2005 23:10, Hans Witvliet wrote:
Only perfect sense for swapping a processes on purpose, might be in a cluster environment, to re-distribute cpu-load....
Swapping has other uses. Swapping rarely used data from main internal memory to free up space for disk cache and read-ahead buffers can improve performance. This is why you can sometimes see swap usage even though you have a gigabyte free.
One situation I was wondering about, was if you had a huge data file. Might it be easier to load the entire file into memory (real & virtual) and process it there, than by reading & writing blocks of the file as necessary?
The Monday 2005-03-07 at 09:31 -0500, James Knott wrote:
One situation I was wondering about, was if you had a huge data file. Might it be easier to load the entire file into memory (real & virtual) and process it there, than by reading & writing blocks of the file as necessary?
Easier for the programmer, perhaps - provided he uses, while developing, a big enough computer or small enough test file :-p nmap() is used, I understand, for just that, copying the file into memory and working with it. As I'm not a linux programmer, I don't know if big files are loaded in full. I have read its man page, but I'm no wiser. -- Cheers, Carlos Robinson
On Monday 07 March 2005 01:10, Hans Witvliet wrote:
On Sun, 2005-03-06 at 19:44, James Knott wrote:
This was more of a curiousity type question. Also, IIRC, you can have multiple swap partitions, so terabyte swap space is now a possibility, though I'd imagine exabyte swap is still a while away.
Incidentally, it wasn't all that long ago, that a fried was bragging that he had a total (4 or 5 drives) of 1 GB disk space on his OS/2 system!
I allready though so, For most "normal" situations, sysadmins consider swap nowadays more as a protection meganism against kernel panics.
Used to be different. I recall the days (on a dec vax/vms 780) and several hundred people working on it, and on piek moments during the week, most of us were watching which users were swapped out ;-)) At that time "swapped/paged-out" was a fact of life. But since then, CPU, cache and mem-speed have rissen 1000-fold; while "background" -memory, or disks in general perhaps 10 or 20-fold. So the effect of a process being swapped out of main-memory is felt much more.
I had a customer once running a dual P3 with 256MB RAM on which our software was running 24/7 monitoring a mine in Canada. Customer complained that he could not load one of our interactive analysis programs - I dialled in only to discover that the swap partition had been corrupted and that the system had been running for 3 weeks without any swap at all (RH7.3). Rerunning mkswap on the partition and reissuing the swapon command fixed the problem. Note that this machine ran a well-defined set of processes which rarely changed and thus swap was not needed. Paul -- Paul Hewlett (Linux #359543) Email:`echo az.oc.evitcaten@ttelweh | rev` Tel: +27 21 852 8812 Cel: +27 72 719 2725 Fax: +27 86 672 0563 --
Paul Hewlett wrote:
On Monday 07 March 2005 01:10, Hans Witvliet wrote:
On Sun, 2005-03-06 at 19:44, James Knott wrote:
This was more of a curiousity type question. Also, IIRC, you can have multiple swap partitions, so terabyte swap space is now a possibility, though I'd imagine exabyte swap is still a while away.
Incidentally, it wasn't all that long ago, that a fried was bragging that he had a total (4 or 5 drives) of 1 GB disk space on his OS/2 system!
I allready though so,
I had a customer once running a dual P3 with 256MB RAM on which our software was running 24/7 monitoring a mine in Canada.
Data mining? ;-)
At 12:07 AM 7/03/2005, James Knott wrote:
One thing I've noticed, is that while there's been lots of talk, over the years, about minimum swap partition size, I don't recall seeing mention of a maximum size. For example, 32 bit CPUs have a maximum addressing range of 4 GB. Since swap is the virtual memory area, does this mean that it's also limited to 4 GB? If so, does that mean that the 64 bit CPUs can have a swap partition(s) of up to 16 exabytes?
tnx jk
From my understanding it's 4GB per partition, but you can have multiple partitions (don't know the limit) as I do for my servers on one site. With each swap partition on their own drive I find my users seem to get better response with their large files than a single partition, though I don't really know why. I discovered it by error back on 7.1 (I think) when i combined two drives into one box and accidentally created a second "live" swap as I forgot to remove it on cleanup of the box's configuration. scsijon
The Monday 2005-03-07 at 21:26 +1100, scsijon wrote:
From my understanding it's 4GB per partition, but you can have multiple partitions (don't know the limit) as I do for my servers on one site. With each swap partition on their own drive I find my users seem to get better response with their large files than a single partition, though I don't really know why. I discovered it by error back on 7.1 (I think) when i combined two drives into one box and accidentally created a second "live" swap as I forgot to remove it on cleanup of the box's configuration.
This is documented, I think: For example, from "/usr/share/doc/howto/en/txt/Software-RAID-HOWTO.gz": | 2.4. Swapping on RAID | | There's no reason to use RAID for swap performance reasons. The kernel | itself can stripe swapping on several devices, if you just give them | the same priority in the /etc/fstab file. And "man 2 swapon" says: | Swap pages are allocated from areas in priority order, highest | priority first. For areas with different priorities, a | higher-priority area is exhausted before using a lower-priority | area. If two or more areas have the same priority, and it is the | highest priority available, pages are allocated on a round-robin | basis between them. For some reason I don't know, Yast chooses "pri=42". Ah! Another interesting information. In "man mkswap", I find: | (new style swap area) The maximum useful size of a swap area now | depends on the architecture. It is roughly 2GiB on i386, PPC, | m68k, ARM, 1GiB on sparc, 512MiB on mips, 128GiB on alpha and 3TiB | on sparc64. That's the maximum size of each swap area, of course, not the total. -- Cheers, Carlos Robinson
participants (8)
-
Allen
-
Anders Johansson
-
Carlos E. R.
-
Hans Witvliet
-
James Knott
-
Paul Hewlett
-
Randall R Schulz
-
scsijon