DATA Step, Macro, Functions and more

What MEMSIZE and SORTSIZE should I choose?

Reply
Contributor
Posts: 54

What MEMSIZE and SORTSIZE should I choose?

I have a DELL XPS 15 with 16gb of RAM and I would like to maximize the performance of SAS.

I have changed the MEMSIZE in the config file to 12 gb and SORTSIZE to 6GB. Would this be optimal? What other options should I change? How about REALMEMSIZE 

By the way, is there a way to change MEMSIZE by running some code? 

Super Contributor
Posts: 273

Re: What MEMSIZE and SORTSIZE should I choose?

Posted in reply to ducman1611

As far as I know, Memsize allocation is a configuration/initialization option and not post-startup option.

Therefore I don't think you can run code to change the memsize value. But I could stand corrected if otherwise,

 

Ahmed

Super User
Posts: 5,829

Re: What MEMSIZE and SORTSIZE should I choose?

Posted in reply to ducman1611
I usually keep SORTSIZE closer to MEMSIZE, in you case perhaps 10GB. Nor sure why SAS have two seperate options?
Data never sleeps
PROC Star
Posts: 2,231

Re: What MEMSIZE and SORTSIZE should I choose?

[ Edited ]

@LinusH @ducman1611

MEMSIZE and SORTSIZE are totally different, and should not have the same value.

See the schema here.

Super Contributor
Posts: 273

Re: What MEMSIZE and SORTSIZE should I choose?

Posted in reply to ducman1611

Here are 

- Paper related to Configuration and Tuning Guidelines for SAS ® 9  in Microsoft Windows Server 2008, that may give you some ideas

- SAS Tech Support Usage Note illustrating SAS® system option settings for best performance in UNIX and Windows environments

 

Ahmed

Super User
Posts: 3,771

Re: What MEMSIZE and SORTSIZE should I choose?

Posted in reply to ducman1611

Increasing your MEMSIZE and SORTSIZE settings to much higher values is unlikely to improve performance much. It will certainly improve performance if you have set them too small but in my experience SAS only uses the memory and sort size it requires for any particular job.

 

Tuning your SAS code is likely to have a much better payoff with regards to performance, the downside being the extra work required.

PROC Star
Posts: 2,231

Re: What MEMSIZE and SORTSIZE should I choose?

Posted in reply to ducman1611

>Would this be optimal? What other options should I change?

You need to use options fullstimer and look at the log, to see where the bottlenecks in your process are.

Are your table sorts all internal sorts (in memory only)?

Is you CPU waiting for the disks to give it data?

Or is the CPU the bottleneck?

When you know where the bottleneck is, you start looking for solutions.

Contributor
Posts: 54

Re: What MEMSIZE and SORTSIZE should I choose?

it is not really a bottleneck as it still ran with the default setting. However it was quite slow compared to after increasing the MEMSIZE and SORTSIZE. My dataset is quite large (>50gb) and sometimes I need to run regressions with fixed effects and double clustering. My experience is increasing the MEMSIZE helps my code to run a bit faster

PROC Star
Posts: 2,231

Re: What MEMSIZE and SORTSIZE should I choose?

Posted in reply to ducman1611

For regressions on that kind of volume, you could try having REALMEMSIZE close to the total amount of available RAM, maybe around 14 GB depending on what else is running.

 

Option MEMSIZE should be larger still, since it includes the paging space.

 

Note that option SUMSIZE only affects procedures MEANS, OLAP, REPORT, SUMMARY, SURVEYFREQ, SURVEYLOGISTIC, SURVEYMEANS, and TABULATE, so not regressions.

 

To see how much RAM is available for SAS to use at any point in time, you can run

%put Free RAM = %sysfunc(putn(%sysfunc(getoption(xmrlmem))/1024**2,comma10.))MB;

 

 

Ask a Question
Discussion stats
  • 8 replies
  • 168 views
  • 5 likes
  • 5 in conversation