Scrigroup - Documente si articole

Username / Parola inexistente      

Home Documente Upload Resurse Alte limbi doc  
AccessAdobe photoshopAlgoritmiAutocadBaze de dateCC sharp
CalculatoareCorel drawDot netExcelFox proFrontpageHardware
HtmlInternetJavaLinuxMatlabMs dosPascal
PhpPower pointRetele calculatoareSqlTutorialsWebdesignWindows
WordXml

AspAutocadCDot netExcelFox proHtmlJava
LinuxMathcadPhotoshopPhpSqlVisual studioWindowsXml

System Performance - Creating or editing a performance log

windows



+ Font mai mare | - Font mai mic



System Performance

XP provides you with a variety of ways to hack your system to juice up its performance. Built-in tools, like the Performance Console, can monitor dozens of performance metrics and then take automated actions when those metrics fall below a certain level. You can make better use of your existing RAM by using a variety of different hacks, and the Registry offers many ways to speed up system performance as well.



In this chapter, we'll cover all those ways, as well as others, to help make sure that XP runs as efficiently as possible.

Hack 91 Track System Performance with the Performance Console

Before you can hack away at things to speed up your computer, you should know how to monitor system performance in the first place. As a power user, you'll like knowing what's causing those slow-downs and blips in performance. The Performance Console is a great hacker's tool for monitoring and tracking resources of all kinds.

Computers get faster every year, but somehow we still end up sometimes waiting around for them to finish a task.

Reducing Visual Effects

Windows XP's visual effects-such as fading and sliding menus, background images for folders, and drop shadows for icon labels-make it the snazziest-looking operating system that Microsoft has yet produced. But all those effects can take their toll on system performance, especially if you have an older computer.

XP gives you the option of balancing these visual effects against system performance. You can go full-bore and use all the visual effects, you can turn them all off, you can have your system decide which to use, or you can pick and choose which effects to turn on and off. Right-click on My Computer and choose Properties >Advanced >Settings (under the Performance section). To turn off all effects, choose 'Adjust for best performance.' To use all visual effects, choose 'Adjust for best appearance.' To turn on and off individual effects, choose Custom, then check the effects you want to use and uncheck the ones you don't. Experiment to see how they affect system performance.

To figure out what's slowing your computer down and get to the root of the problem, use the Performance Console (perfmon) to track and graph the activities of Windows XP and its components. First, I'll show you how to set up a log, and then I'll give you some ways to put the console logs to good use.

2.1 Setting Up Your Logs

Choose Start >Run and type perfmon. You'll see the Microsoft Management Console (MMC), with the Performance titlebar. In the left pane, click System Monitor to see a graph of your current system performance, including your processor, memory, and disk. You can use the toolbar buttons to configure the graph data and format. This graph is useful for seeing what's going on now, but it's useless for looking at the long-term picture.

To create log files of your system's performance, click Performance Logs and Alerts in the left pane of the MMC. You can create counter logs (with the values of performance indicators, measured on a regular basis), trace logs (with the values of performance indicators when something happens, such as a program crash), and alerts (an action for Windows to take when a counter hits a specified value). Log files stored in text format contain one line per observation, with values separated by either commas or tabs, and are usually stored in the C:Perflogs folder. You can import these log files into a spreadsheet or database for analysis, reporting, and graphing. SQL and binary (nontext) log file formats are also available. (See article Q296222 in the Microsoft KnowledgeBase for how to log data directly to an SQL database.)

Create a counter log by right-clicking Counter Logs in the left pane and choosing New Log Settings from the shortcut menu. Specify the statistics you want to log by clicking Add Counters on the General tab of the Properties sheet for the log (see Figure 11-1). A nice feature of this utility is that you can choose whether to monitor the local computer or another computer on your LAN. Don't add more than a few counters, or your log file will grow quickly and be confusing to analyze. To select a counter, first select the performance object (i.e., the part of the computer system you want to monitor, such as memory or disks), and then choose counters from the list.

Figure 11-1. Creating or editing a performance log

Set the interval to the frequency you'd like to sample the data. Don't choose too frequent an interval, or your log file will take over your entire hard disk (start with once a minute). On the Log Files tab, specify the file type, name, and location. If you plan to import this file into a spreadsheet or database program, choose Text File (comma-delimited) for the type. On the Schedule tab, specify when the log start and stops-manually, or automatically on a schedule.

The Performance console itself can slow down your computer considerably. Run it only when you need it, and don't set the logging interval to be too short. Set logs to stop after a day or two; otherwise, they'll run until your hard disk fills up.

2.2 What to Watch

These counters are often worth logging:

MemoryPagessec

Number of pages read from disk or written to disk when Windows runs out of memory. Swapping information to and from the disk can slow down your system significantly. Consider adding more memory.

PhysicalDiskAvg. Disk Queue Length

Number of read and write requests are waiting for the disk to respond. High numbers indicate that a faster disk drive would speed up performance.

PhysicalDisk% Disk Time

Percentage of the time the disk was busy. This is another indicator of a slow or overloaded disk.

Processor% Processor Time

Percentage of the time the processor was busy with all types of processes. This counter can tell you whether delays are caused by an overloaded CPU.

2.3 Viewing Performance Logs

With the System Monitor in the MMC, you can view a log as a graph. Click System Monitor in the left pane of the MMC window and click the View Log Data icon on its toolbar. Add the log file to the list. When you are looking at the graph, click the Properties button on the toolbar to change how the graph looks.

To look at the contents of a comma-separated (.cvs) log file in Excel or your default spreadsheet program, double-click the filename in Windows Explorer. Excel may complain that the file is still open (since the Performance Console is still appending information to it); click Notify to see what's in the file so far. In Excel, you can analyze, graph, and print the counters.

2.4 Performance Alerts

Create an alert to let you know when a counter exceeds a specified value. For example, the Performance Console can let you know when the idle processor time drops below 10%. Right-click Alerts in the left pane of the MMC window and choose New Alert Settings to create a new alert. Add one or more counters, and specify the limit (upper or lower) beyond which Windows should take action. On the Action tab, specify what Windows does when the alert occurs: specifically, you can have it add a note to an event log or run a program.

Hack 92 Getting the Most Out of Your RAM

The best way to improve system performance is to make better use of your RAM. Here are several hacks to show you how to try this before you buy more.

No matter how much memory you have, you could always use more. Installing more RAM is generally the quickest way to better XP performance.

But you can also speed up XP by making better use of the RAM you already have. In this hack, we'll look at how you can speed up your system performance by using your RAM more effectively.

3.1 Make Better Use of Your Memory with the Task Manager

If your system doesn't have enough RAM, or if it uses what it has improperly, your system slows down. That's because in those circumstances it moves data and programs to a paging file on your hard disk, and your hard disk is slower than RAM. A certain amount of this is normal, but if you use a paging file too much, or if even your paging file can't handle the memory load, you'll run into system slowdowns and problems.

The Task Manager's Performance tab, shown in Figure 11-2, provides the best way to monitor memory use. To run the Task Manager, press Ctrl-Alt-Delete, then click on the Performance tab. With it, you can interpret the information and make better use of your memory.

Figure 11-2. The Task Manager's Performance tab

The most important parts the screen shown in Figure 11-2 are the charts that report on paging file use and the tabular material below it that give a more detailed view of your current use of memory.

The charts relating to the Page File are self-explanatory; they show current usage, as well as usage over time. If you see that Page File use is frequently high, it means either that your system isn't making the most efficient use of RAM, or you need more RAM. In that case, follow the advice later in this hack for how to make better use of RAM.



The data below the Page File chart can be almost impossible to decipher. Table 11-1 details what the data means, and makes recommendations on how to use that information to make better use of RAM.

Table 11-1. Understanding Performance tab memory reporting

Category

Subcategory

What the data means

Totals

Handles

Lets a program use system resources such as registry keys, fonts, and bitmaps. Sometimes, poorly written programs don't close their handles down when the program closes, leading to memory loss. As a practical matter, you won't need to monitor this number.

Threads

A discrete portion of a program executing a single task independently of other parts of a program. Again, as a practical matter, you won't need to monitor this number.

Processes

Reports on the number of programs and services (processes) currently running on your system. Monitor this to see whether you have too many programs and services running on your PC. To shut down unnecessary services, see [Hack #4].

Commit Charge (K)

Total

The total amount of physical memory (RAM) and virtual memory (page file) currently in use, in kilobytes. The more programs, files, and data you have open, the greater your commit charge will be. The greater the commit charge, the more demands will be put on your system. To reduce the commit charge, close programs and files, especially large files.

Limit

Reports on the total amount of physical and virtual memory that is currently available for your PC, measured in kilobytes. To increase the limit, you can increase the Page File size (see article 4.9 'Optimize Your Swap File Size') or add RAM to your system.

Peak

Reports on the highest total amount of memory, measured in kilobytes, that has been in use during your current session. Check this value each session to see whether the Peak value is frequently at or near the Limit value. If it is, you need to increase your memory, by either adding RAM or increasing your Page File size.

Physical Memory (K)

Total

Displays the total amount of RAM in your PC, in kilobytes. This number can be confusing; to find out the amount of RAM in megabytes, divide it by 1,024.

Available

Reports on the total amount of RAM, in kilobytes, currently available. When available RAM is used up, your system begins to use its Page File.

System Cache

Reports on the total amount of RAM, in kilobytes, that is being used for the most recently accessed data and programs. Programs and data can be in the system cache even after they have been closed down; the PC looks to the system cache first when opening a program or file, since it can be opened from the cache faster than from the hard disk.

Kernel Memory (K)

Total

The total amount of memory, in kilobytes, in use by the primary components of the XP kernel. The kernel is the core programs and files that make up the operating system.

Paged

The total amount of memory in a Page File, in kilobytes, used by the primary components of XP.

Nonpaged

The total amount of memory of RAM, in kilobytes, used by the primary components of XP.

Here's how to use the information on the tab to make better use of RAM:

If the Total Commit Charge exceeds the Total Physical Memory, you probably need more RAM. When the Commit Charge is regularly higher than the Physical Memory available, it means that you have to regularly use a Page File, which slows your system down. Buy more RAM; it's inexpensive and will boost system performance.

Before running a memory-intensive application, use the Processes Tab to identify memory-hogging applications, and close them down. The Processes tab of the Task Manager lists every process and program in use and shows the total amount of memory each uses. Click twice on the Mem Usage heading on the tab to reorder the list of programs and processes so that those that require most memory show up at the top. Close down programs that you don't really need before running a memory-intensive application.

If the Peak Commit Charge is frequently at or near the Limit Commit Charge, you need to increase your memory. When this occurs, it means that your PC is frequently out of memory or close to being out of memory. Either add RAM or increase your Page File size.

3.2 General Advice for Making Better Use of RAM

So, you've learned how to use the Task Manager. Here are some additional tips for making better use of your existing RAM:

Remove DLLs from cache memory. If you notice your system running slowly after XP has been running for some time, or if your RAM seems to be getting low for some reason, the culprit may be left-behind DLLs from programs that are no longer running, but that XP still keeps in memory. Sometimes XP keeps DLLs in cache memory even when the program that required them is no longer running, and this cuts down on the memory available to other applications.

You can use a simple Registry hack to have XP automatically remove from cache memory DLLs that are no longer needed by programs. Run the Registry Editor [Hack #68] and go to HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionExplorer. Create a new DWORD value named AlwaysUnloadDll, and give it a data value of . Exit the Registry and reboot for the new setting to take effect. Note that this setting may cause problems with some programs. Some Windows programs-especially older and 16-bit programs-may issue error messages with this setting in effect; so if that starts happening, delete the new key or give it a value of .

Reduce the number of colors. Using 32-bit color takes up a great deal more memory than 16-bit color, and it also puts a greater strain on your processor. If you primarily use business applications such as word processors and spreadsheets, you most likely won't notice a different between 16-bit and 32-bit color, so going with 16-bit color is a good bet. To change your color depth, right-click on the desktop, choose Properties >Settings, and in the Color Quality box choose 16 bit.

Avoid DOS applications. DOS applications don't allow XP to manage memory properly, and they hold onto the memory they use, not allowing it to be swapped out for use for other programs or processes. If you use any DOS applications, replace them with Windows versions.



Reduce the icons on your desktop. Every icon on your desktop uses up memory. Delete icons you don't use regularly. Run the Clean Desktop Wizard, which will automatically delete icons that you don't regularly use. Right-click on the Desktop and choose Properties >Desktop >Customize Desktop >Clean Desktop Now. A wizard will step you through the process of deleting unused icons. If you want the wizard to run every 60 days, check 'Run Desktop Wizard every 60 days.'

Reduce the applications and services running in the background. You may have many programs and services running in the background, without realizing it. Look at your Notification area, and see if there are any programs running that you don't require. Shut them down, and make sure that they don't load at startup. Also, XP frequently starts services on startup that you might not need [Hack #4]. For example, if you don't use a wireless network card, you don't need the Wireless Zero Configuration service.

Hack 93 More Power: Registry Hacks to Speed Up XP

Put your Registry-hacking knowledge to good use: hack your way to running Windows XP at top speed.

Creating and marketing tuning and customization utilities for the Windows XP operating system is quickly becoming big business. A Google search will turn up hundreds of sites and programs dedicated to tweaking Windows XP. But no matter what type of interface is developed to make system tweaking easier and safer for the average user, the end result is that the changes are reflected in XP by modifying the Registry. For some people, commercial tweaking utilities may be the method of choice, but with a few precautions and safeguards it's possible to enhance system performance without any tools other than those supplied with Windows XP.

As you learned in Chapter 7, you can use Regedit [Hack #68] to edit the Registry. Make sure you take the precautions outlined in that chapter and back up your Registry [Hack #71] no matter how comfortable you are editing the thing.

No single tweak is going to take an ancient PC and turn it into a gamer's dream machine. It's even unlikely that a number of tweaks will achieve substantial performance gains, but every little bit does help. As long as you keep your expectations realistic, you'll learn something about the Registry and hopefully see a performance increase in the process.

4.1 Menu Speed

When XP first appeared, there was a lot of conversation about the new interface, both good and bad. In spite of the initial complaints, most users stick with the default settings rather than reverting to the Classic interface found in previous Windows versions. But you may want to change the delay you notice when you click on the Start Menu. I see no reason for there to be any delay when I click on the Start Menu. Effects are pretty, but I wouldn't click on it if I didn't have business inside, so let's get it open and get moving. The default speed can be adjusted with a quick Registry hack.

Go to the Registry key HKEY_CURRENT_USERControl PanelDesktopMenuShowDelay. The default value is . Set it to to remove the delay completely, but if you do that it will be nearly impossible to move the mouse fast enough not to activate All Programs if you mouse over it en route to your final selection. Pick a number that suits your style, make the change, then test it until you find a good compromise between speed and usability.

4.2 Place Windows Kernel into RAM

It's a given that anything that runs in RAM will be faster than an item that has to access the hard drive and virtual memory. Rather than have the kernel that is the foundation of XP using the slower Paging Executive functions, use this hack to create and set the DisablePagingExecutive DWORD to a value of .

Perform this hack only if the system has 256 MB or more of installed RAM!

Edit the Registry key HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlSession ManagerMemory ManagementDisablePagingExecutive to to disable paging and have the kernel run in RAM (set the value to to undo this hack). Exit the Registry and reboot.

4.3 Alter Prefetch Parameters

Prefetching (the reading of system boot files into a cache for faster loading) is a commonly overlooked component that can have a significant impact on system boot time. This tweak allows you to select which components will make use of the prefetch parameters. To see which files are gathered using each of the settings, clear the prefetch cache located at C:WindowsPrefetch and then enable one of the settings listed in this hack. Clear the cache and repeat for each setting.

Set the Registry key HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlSession ManagerMemory ManagementPrefetchParametersEnablePrefetcher to to disable prefetching, to prefetch application launch files, to prefetch boot files, or to prefetch as many files as possible.

4.4 Disable 8.3 Name Creation in NTFS

Files that use the 8.3 naming convention can degrade NTFS drive performance. Unless you have a good reason for keeping the 8.3 naming convention intact (such as if you're using 16-bit programs), a performance gain can be achieved by disabling it:

Set the Registry DWORD key HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlFileSystemNtfsDisable8dot3NameCreation to . Exit the Registry and reboot.

Hack 94 Repair and Recovery with the Recovery Console

If Windows won't start, use the DOS-like Recovery Console to make repairs.

The Recovery Console is one of the last-ditch tools you can use if your Windows installation doesn't start up at all. Before you resort to the Recovery Console, if Windows starts up, make sure you've already tried System Restore (especially if you've recently changed your hardware).

To run System Restore, choose Control Panel >Performance and Maintenance >System Restore.

If it won't start, try running the Windows XP Setup Wizard from the installation CD and choosing its Repair option, or try starting Windows in Safe Mode.

If none of these easier paths work, you're stuck using the DOS-like Recovery Console to figure out what's wrong with Windows, your system or boot partition, or your disk's master boot record (MBR). You can use its DOS-like commands to look at the files and folders that make up Windows, and possibly repair them. You can also repair the master boot record and boot sector.

You can configure the Recovery Console not to require the administrator password on login. In the Registry Editor [Hack #68], set the value of key HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsNTCurrentVersionSetupRecoveryConsoleSecurityLevel to .

5.1 Starting the Recovery Console

To start the Recovery Console, boot your computer from the Windows XP installation CD and follow the prompts. When it asks which Windows installation you want, type the number of the installation ( , if Windows XP is the only operating system installed) and press Enter. Type the password for the Administrator account. When the Recovery Console is running, you see the prompt D:WINDOWS>, which tells you the name of the current folder (directory).

If you plan to use the Recovery Console often, add it to your boot menu (the menu that appears if you have a multiboot system). You must be logged in as an administrator. Choose Start >Run and type the command d:i386winnt32.exe /cmdcons (replace d: with your CD drive's letter if it's not D). The Recovery Console occupies about 7 MB of disk space and stores its program files in Comdcons on your system drive.



Now you can type commands and press Enter, just like in the good old days of DOS! However, not all DOS commands work (see Section 5.5 at the end of this hack), and you can't examine files in all folders. You are restricted to the Windows program folder (C:Windows on most systems), its subfolders, the root folder of the Windows partition (C: on most systems), removable drives (including diskette, ZIP, and CD drives-but these are read-only), and the Cmdcons folder (which contains the Recovery Console program itself, if you have added it to your boot menu).

If you know DOS, the Recovery Console's commands look familiar, though only a few are available and some work differently. To see a list of all the available commands, type help and press Enter. To find out how a specific command works, type the command, followed by a space and (for example, expand /?). When you are done using the Recovery Console, type exit and press Enter to reboot your computer.

5.2 Looking Around

Use these commands to examine your system:

cd folder

Changes the current folder to the folder you name. In the folder name, two dots ( represents the parent folder of the current folder. To move to a different drive, type its drive letter and a colon and press Enter.

dir folder or dir filename

Lists the contents of the folder, including files and subfolders. For the filename, you can use * as a wildcard character (for example, dir *.dll). You see the last modification date and time, attributes, size (in bytes) and filename. The attributes are represented by letters: d (directory or folder), h (hidden), s (system), e (encrypted), r (read-only), a (changed since last backup), and c (compressed).

map

Lists the drive letters with their file format (FAT32 or NTFS), size, and pathname.

type filename

Displays the contents of the file as text. For executable, graphic, and other nontext files, you see garbage.

If a filename or pathname includes spaces, enclose it in double quotes.

5.3 Fixing the MBR, Boot Sector, or Boot Menu

If your system can't find a partition from which to boot, try fixing the MBR. Type fixmbr to rewrite the MBR on the boot partition (the drive or partition from which the computer starts up).

If the system finds the boot partition but the Windows boot sector is fouled up on the Windows partition (the drive or partition where Windows is installed), rewrite the Windows boot sector by typing fixboot. To specify which drive is the Windows partition, you can add the drive letter (e.g., fixboot c:).

Windows XP includes a boot menu that allows you to choose which operating system to start up. (It doesn't appear if your system has only one operating system.) To fix the boot menu, use the bootscan command. Type bootcfg /scan to look at all your partitions and drives, scanning for Windows installations. Type bootcfg /list to list the entries in boot.ini (the file that contains your boot menu entries).

5.4 Fixing Windows

If something is wrong with your Windows installation, use these commands to modify or replace the problematic files:

attrib filename flag

Changes the attribute of a file (filename). The flag is (adds, or turns on) or - (removes, or turns off), followed by r (read-only), s (system), or h (hidden).

chkdsk drive

Checks and repairs files and folders on drive. Add the /p switch to check the drive even if no problems are marked.

copy sourcepath1 sourcepath2

Copies the file from sourcepath1 and names the new file sourcepath2. The asterisk wildcard ( ) doesn't work, so you can copy only one file at a time.

diskpart

Lets you add or delete partitions, though you can't resize or move them. (For that, you need a program like PartitionMagic; go to https://www.partitionmagic.com.)

expand pathname

Decompresses files from a .cab file and puts the result in the current folder. If the .cab file contains more than one file, add /f:* to extract all the files. Or add /f:* /d to list all the files in the .cab, and then use expand pathname /f:filename command to extract just the one you want.

5.5 Hacking the Hack

By default, the Recovery Console doesn't allow you to use wildcards, copy files from local drives to removable media, or use the cd command to list files in subfolders in all folders on all local disks. It also issues a warning message every time you copy files that overwrite existing files.

However, if you have the Professional Edition, you can change that behavior using the Group Policy Editor. At a command prompt, type gpedit.msc to run the Group Policy Editor. Go to Local Computer PolicyComputer ConfigurationWindows SettingsSecurity SettingsLocal PoliciesSecurity Options. In the list of policies on the right, double-click on 'Recover console: Allow floppy copy and access to all drives and all folders.' Select the Enabled option and click OK.

Doing this won't actually make the changes; at this point, you'll have to use the Recovery Console itself to do that. Open the Recovery Console and use the following commands to customize its behavior:

set allowwildcards = true

This command lets you use the and ? wildcards with the Recovery Console commands.

set allowallpaths = true

This command lets you use the cd command to list all files and subfolders on all folders on all local disks.

set allowremovablemedia = true

This command lets you copy files from local drives to removable media.

set nocopyprompt = true

This command lets you copy files that overwrite existing files, without getting a warning prompt.





Politica de confidentialitate | Termeni si conditii de utilizare



DISTRIBUIE DOCUMENTUL

Comentarii


Vizualizari: 1082
Importanta: rank

Comenteaza documentul:

Te rugam sa te autentifici sau sa iti faci cont pentru a putea comenta

Creaza cont nou

Termeni si conditii de utilizare | Contact
© SCRIGROUP 2024 . All rights reserved