Do these 3 things before closing this tab:
1Fix the driver behind crashes, sound loss and screen glitches2Clear out junk files and repair common Windows errors3Scan for outdated or missing drivers - takes under a minuteiTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more
Set both behaviors when you create the container, or change them later with docker update. A typical manually managed service might use --restart unless-stopped, a hard memory ceiling of 512m, a lower soft reservation of 384m, and --cpus 1.5—but those numbers are examples, not universal defaults.
Restart policies decide when Docker starts a stopped container. Resource limits decide how much memory and CPU it may consume. The correct values depend on the workload, host capacity, available swap, kernel support and whether another system is responsible for process supervision.
Start with a deliberate policy and measured limits
Docker containers have no resource constraints by default; they can consume as much of a resource as the host kernel scheduler allows. Docker’s documentation warns that host memory exhaustion can cause the kernel to kill processes, including Docker or other important host applications. Set limits only after observing the application under representative load, then test the failure behavior before relying on the configuration in production. See Docker’s resource-constraints documentation.
The following command creates a detached container with both restart and resource settings:
#1 Best Overall
- Powerful Turbo Fan:CAGIWIRU Electric Air Duster have reached speed up to 130000RPM,Can efficient remove dust and debris.With LED light and Three Adjustable Speed to meet with different cleaning tasks.
- With Attached USB C Fasting Charging cable.Charing 3 hours,Enjoy up to 240 minutes of use on the lowest setting, For third speed can use for 25mins.with four charging options to meet with your needs.
- Wide Application: attached 5 different nozzles,making it suitable for a variety of scenes, such as car,pet, pc, keyboards, and other electronic devices. It also serves for office and home clean duster.
- Handy Design & Portable:Cordless air duster electric nozzle is Light weight and small size, design and comfortable to hold and space saving, convenient to carry around. You can put it in your room or inside the car without taking up space.
- Economical &Reusable: Built durable materials with a long-lasting battery,our CAGIWIRU air duster it's a sustainable alternative to disposable air cans.
docker run -d
--name app
--restart unless-stopped
--memory 512m
--memory-reservation 384m
--cpus 1.5
example-image:tag
unless-stoppedrestarts the container automatically while preserving an explicit manual stop across Docker daemon restarts.--memory 512mis a hard memory ceiling of 512 MB for this example.--memory-reservation 384mis a soft target used under memory contention; it is not a promise that usage will stay below 384 MB.--cpus 1.5applies a CPU quota of up to one and a half CPUs.
Choose values from observed peak use, headroom for bursts and the capacity that must remain available to the host and other containers. A limit that is too low can make a healthy workload fail; no limit can let one container destabilize the machine.
Choose the restart policy that matches the failure you want to recover from
Docker documents four container restart policies. The default is no, which performs no automatic restart. The policy is selected with --restart on docker run or changed later with docker update. The official descriptions and lifecycle rules are in Start containers automatically.
| Option | What it does | When it fits |
|---|---|---|
--restart no |
No automatic restart; this is Docker’s default. | Use when an operator, a separate supervisor or a higher-level orchestrator should decide what happens after exit. |
--restart on-failure[:N] |
Restarts after a non-zero exit. The optional N caps the number of retries. |
Useful for a batch or service that should be retried only when it reports failure. It does not restart merely because the Docker daemon restarted. |
--restart always |
Restarts the container when it stops, including after a daemon restart. An explicit manual stop suppresses policy-driven restarts until the daemon or container is restarted. | Use when the container should generally be running again after any stop, while understanding the manual-stop exception. |
--restart unless-stopped |
Behaves broadly like always, but an explicit manual stop remains in effect across a Docker daemon restart. |
Often matches a manually managed service whose operator wants a stop to stay stopped until intentionally reversed. |
These are container restart policies, not Swarm service restart configuration. Do not combine Docker’s restart policy with a host-level process manager unless you have designed the interaction; two supervisors can repeatedly start and stop the same workload. Restart policies also are not the same as --live-restore, which addresses daemon upgrades and has a different purpose.
The Tool Desk
Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Understand the lifecycle edge cases before relying on automation
Successful startup must last at least 10 seconds
Docker does not apply a restart policy immediately to every short-lived launch. A container must run successfully for at least 10 seconds before Docker considers the start successful for restart-policy purposes. This prevents a rapidly failing initialization from being treated as a stable service. If a process exits during that initial period, do not assume the policy will create an unlimited retry loop.
on-failure reacts to exit status, not daemon restarts
on-failure is tied to a non-zero container exit. If the Docker daemon restarts while the container is otherwise stopped or has not failed in that way, this policy alone does not bring it back. Select always or unless-stopped when recovery after daemon restart is part of the requirement.
Manual stops are intentional overrides
Stopping a container manually suppresses policy-driven restarting until the Docker daemon is restarted or the container is manually restarted. With unless-stopped, the stopped state also survives a daemon restart. This difference matters during maintenance: a command such as docker stop app is not equivalent to a transient crash.
Rank #2
- Screen Cleaner is Your Screen’s New Bestfriend! - EVEO is proud to present a screen cleaner that’s perfectly suited for your TV. Meet your new screen cleaner, computer screen cleaner, laptop cleaner, iPad cleaner, Macbook,tv cleaner or any other electronic device. Our screen cleaner spray and wipe along with the included plush microfiber cloth, easily removes dust, fingerprints & other smudges on the screen’s surface. Clean effectively for a streak-free screen
- Gentle on your Screens - Our screen cleaner spray and wipes is compatible to be used even for the most sensitive LCD, LED, CRT, and OLED screens in proper use. Be at ease knowing that this product is compatible with all the major brands: LG, SONY, Samsung, Sharp, iPad, iPhone, Android screens, Kindle, PC monitors - we’ve got you covered! Can be used as LCD screen cleaner, tv cleaner, smart tv screen cleaner, and more
- Premium Super Soft Plush Microfiber Cloth - Included in this efficient screen cleaning kit. This screen cleaner spray and wipe has our signature plush microfiber cloth specially designed to comply with screens and monitors and leave them streak-free. Has been shown to effectively absorbs stubborn stains, zero streaks, and no fiber shedding. Always use this together with our screen cleaner for the best results
- Easy-to-Use Screen Cleaner Kit + microfiber cleaning cloth - The EVEO Screen Cleaning Kit will easily be your new favorite tool when it comes to taking care of the things you love most, quick and easy solution for a streak-free screen. Simply screw on the sprayer gun on the screen cleaner bottle. Spray the cleaning liquid onto the microfiber cloth, then wipe the screen until desired cleanliness & shine is achieved.
- Quality Screen Care Kit Worth Purchasing - Enjoy a convenient Screen Cleaner anytime, anywhere you need it. Your satisfaction is our top priority. We stand behind the quality of our products and that’s why, you shouldn’t be worrying at all. We manufacture the Best Screen Cleaner. and can be used for laptop cleaning kit, laptop screen cleaner, tv screen cleaner for smart tv. MacBook screen cleaner, monitor cleaner or screen cleaner spray for electronic devices with microfiber cleaning cloth
A restart is not a health check
Restart policies respond to container process termination and Docker’s lifecycle events. They do not determine whether an application is serving correct responses. If a process remains running while the application is unhealthy, a restart policy by itself will not detect that condition; use an appropriate health-monitoring design at the platform level rather than treating the policy as an application probe.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Create a container with restart and resource settings
Build the command from the workload requirements
Place the option values before the image name. The image and its command come last. The example below is intentionally conservative for a small service, not a recommendation for every application:
docker run -d
--name app
--restart unless-stopped
--memory 512m
--memory-reservation 384m
--cpus 1.5
example-image:tag
The hard limit and soft reservation can be used together, but the reservation should be lower than the hard limit. If the application normally needs more than 512 MB, increasing the hard limit—or reducing the application’s working set—is safer than hoping the soft reservation will protect it. If the host cannot spare the requested capacity, adding a limit does not create physical memory or CPU.
Use a restart count when failures should eventually stop
To limit retries after non-zero exits, append a count, for example:
docker run -d --name worker --restart on-failure:5 example-image:tag
This asks Docker to retry up to five times after failure. It does not turn the container into a daemon-restart recovery mechanism, and it does not replace diagnosing the exit cause.
Free tools Windows power users keep installed
One-click scans. No signup required.
Change an existing container without recreating it
Use docker update to change restart and resource configuration on an existing container. To change only the restart policy:
Rank #3
- 【Large size】:Measuring 800 x 300 mm/ 31. 5×12 inches, which is wider and taller than others. Large mouse pad can perfectly fit your keyboard and mouse of any size, and there is also ample space for peripherals such as phones, tablets, etc.
- 【LED backlight mouse pad】:Blade Hawks RGB mouse pad provides 7 static modes and 7 dynamic modes will give you the options you are looking for. Power-off memory function remembers the last lighting mode you selected. The super glow fiber Chroma will give you a colorful gaming setup that you want.
- 【Anti-slip rubber base】:Made from Natural rubber, this gaming mousepad will firmly grip your desktop, allowing you to enjoy the ultimate precision in the games you are most passionate about. It also comes with a texture that enhances this ability even further.
- 【Smooth and waterproof surface】: Micro-textured cloth surface, for extremely precise mouse control and a smooth movement. When liquid splashes on the gaming mouse pad, it forms water droplets and slides down. Will not delay your work or gameplay.
- 【Plug and play】: This mouse and keyboard pad is powered by USB, plug and play, no driver required. One button control light modes. Press one time to change the lighting mode, press twice to change the brightness, press and hold about 3 seconds turn ON/OFF.
docker update --restart unless-stopped app
Docker also documents docker update for resource settings. For example, where the installed Engine version accepts these options and the host can support them:
docker update
--memory 768m
--memory-reservation 512m
--cpus 2
app
Consult the Docker container update CLI reference for the exact syntax, option constraints and behavior supported by your Engine release. A change to a limit is not evidence that the new value is safe; observe the workload again after changing it.
Set memory limits without confusing hard and soft controls
--memory: a hard maximum
--memory sets the container’s hard memory maximum. Docker documents a minimum value of 6 MB. A hard limit protects the host from an unbounded container, but it can also trigger out-of-memory handling when the application needs more than the configured ceiling. Pick a value that covers normal use and expected bursts while leaving capacity for the operating system, Docker and other workloads.
docker run -d --name api --memory 1g example-image:tag
The suffix expresses the amount, such as m for megabytes or g for gigabytes. Treat the limit as an enforcement boundary, not as a target the process should reach.
--memory-reservation: a soft limit under contention
--memory-reservation is activated when the host is under memory pressure. It gives Docker a lower target for reclaim and scheduling decisions, but it does not guarantee that the container will remain below that amount. A process can exceed the reservation when capacity is available. When both options are set, keep the reservation below the hard --memory ceiling:
docker run -d
--name api
--memory 1g
--memory-reservation 768m
example-image:tag
--memory-swap: combined RAM and swap allowance
--memory-swap controls the combined memory-plus-swap allowance and only has meaning when --memory is also set. The result depends on whether the host has swap enabled and on kernel support. A configured number is therefore not automatically available swap capacity. Check the host’s swap configuration and the documentation for the Docker Engine and platform you operate before relying on this setting. The option relationships and examples are described in Resource constraints and Running containers.
Rank #4
- 【Softer and More Comfortable】Vaydeer wrist rest has unique diamond pattern, which is the combination of softness and aesthetics. The materials of wrist rest are improved into higher quality memory foam and covered with silky smooth lycra. The computer wrist rest makes you as comfortable and cushiony as like rest your wrists on clouds.
- 【Ergonomic Wrist Saver】The wrist rests for keyboard and mouse comes with a 17.32×3.15×0.83 inch keyboard wrist pad and a 5.94×3.15×0.83 inch mouse wrist support. Based on ergonomic design, the unique concave shape is the perfect fit for your wrist joints. The wrist rest pad fits most computer keyboards and laptops, improve hand and wrist posture, release your wrist and arm stress.
- 【Non-Slip Rubber Bottom】Featuring an anti-skid silicone base on the bottom, this wrist keyboard support stays firmly in place on your desk, preventing the padding from sliding around, ensuring stable and consistent wrist support during extended computer sessions.
- 【Better Experience & Pain Relief】Our keyboard arm rest is beneficial to alleviate the soreness caused by direct contact and friction between your arm and a hard desk surface, reducing the risk of wrist fatigue or carpal tunnel. The soft texture of memory foam can evenly distribute the pressure around your wrists and provide good support with just enough give.
- 【Helpful in Multiple Scenarios】Whether you're working, studying, writing, typing, gaming, this keyboard and mouse rest combo is an essential accessory to add comfort and support to your hands and wrists. It’s also a great gift for men, women, family, friend, coworker, gamer, teacher, etc.
docker run -d
--name api
--memory 1g
--memory-swap 2g
example-image:tag
In this example, the combined allowance is 2 GB, of which up to 1 GB is the memory limit. It does not promise that 1 GB of swap is physically present or that swapping will have acceptable performance.
Be cautious with out-of-memory behavior
When a container or the host runs out of memory, the kernel can kill processes. Docker advises against casually disabling this protection with --oom-kill-disable; if you use that option, Docker’s guidance says a memory limit must also be set. A disabled kill does not create memory and can leave the host exposed to a broader outage. Prefer sizing, load testing and application-level memory controls first.
Control CPU with a ceiling or a relative priority
--cpus: the simple CPU quota
--cpus expresses a CPU-time ceiling as a count of CPUs. For example, --cpus="1.5" allows up to one and a half CPUs worth of scheduled time when the workload can use it:
docker run -d --name batch --cpus="1.5" example-image:tag
This is a cap, not a reservation. A container may use less when idle, and it can be throttled at the ceiling even if the application would benefit from more CPU.
--cpu-shares: relative weight during contention
CPU shares provide relative weighting when containers compete for CPU. They do not reserve a fixed fraction, guarantee a minimum CPU allocation or cap the container by themselves. A container with a higher share receives more of the CPU available during contention, but if no other workload is competing, it may still use the available CPU subject to other limits.
docker run -d --name reporting --cpu-shares 512 example-image:tag
Use shares when the requirement is “prefer this workload over that one under contention.” Use --cpus when the requirement is “never let this workload exceed this CPU amount.” They can be combined when both a ceiling and a relative priority are needed.
Best Value
- 【No Drill Mounted】Cable management tray can be assembled in as little as 3 minutes or less-simply. Side clips easily clampe the edge of desk, pass through the holes on the sides, and secure excess cables with baskets. Desk cable management supports inward or outward installation to meet your needs in different scenarios, and provides you with great convenience when collecting and organizing wires.
- 【Rubber Pad Protects Desk】Wire organizer under desk built-in soft rubber pads on the clamp protect your desk from scratches, so you will not damage your furniture or office.
- 【Sturdy and Beautiful】Cord management under desk is made of high-quality carbon steel and holds about 15 lbs. The wire basket has 2 holes on each side of the tray to enable your cables to pass freely. Cable baskets are suitable for desk thickness use from 0.4" to 2.4".
- 【Space Saving & Keep Organized】Desk cable management tray holds all your power cords, outlet strips, USB hubs and computer transformers hidden from your feet, and the data cables will not enter the vacuum cleaner to keep your desk clean and tidy. Desk wire organizer is also suitable for use in the kitchen and outdoors.
- 【Reduce Safety Risks】Cable tray under desk keeps all plugs away from your kids, no more worry about tripping. Using 2 holes wire tray saves extra space, helps you easily cabling and wire protection. The mesh design is not easy to accumulate dust, but avoids safety accidents caused by messy wires.
Advanced quota flags and kernel support
Docker’s CPU controls are implemented through kernel scheduling and cgroup features. The documented default CFS period is 100,000 microseconds; lower-level period and quota flags exist for cases that need finer control, but their behavior depends on platform and kernel support. Prefer --cpus unless you have a reason to manage those lower-level values and have verified them against your installed Engine version.
Measure actual use before tightening limits
Docker provides docker stats for live CPU usage, memory usage and the configured memory limit. Start with the container name:
docker stats app
Leave the command running while the application handles representative traffic, scheduled jobs, startup, cache warm-up and its largest expected request. A single snapshot cannot establish a safe production limit. Record the highest sustained and burst memory use, CPU demand and restart behavior, then repeat the test after applying limits. The runtime metrics format is documented at Docker runtime metrics.
Quick wins for a faster PC:
Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Clear out junk files and repair common Windows errorsFree Scan →A practical sizing sequence
- Measure unconstrained behavior in a controlled environment. Observe normal and peak workload periods before choosing a ceiling.
- Reserve host capacity. Subtract the memory and CPU needed by the operating system, Docker and other services; do not allocate every host resource to containers.
- Set a hard memory ceiling above measured peaks. Include application bursts, runtime overhead and a margin, but keep the value below what the host can safely provide.
- Set a lower reservation only when it represents a useful pressure target. Remember that it is soft and can be exceeded.
- Choose a CPU cap from latency and throughput requirements. A cap that is numerically convenient may still cause throttling during bursts.
- Apply the restart policy that matches the failure contract. Decide whether non-zero exits, daemon restarts, manual stops or retry limits should trigger recovery.
- Load-test the constrained container. Confirm that the application fails in a controlled, observable way when it reaches a limit.
- Recheck after upgrades. Engine versions, kernels, Docker Desktop environments and workload versions can change resource behavior.
Diagnose common surprises
The container does not restart after a daemon reboot
- If the policy is
on-failure, that is expected: the policy responds to non-zero exits, not to a daemon restart by itself. - If the container was manually stopped, Docker suppresses policy-driven restart until the daemon or container is restarted.
- If you need a manual stop to persist across daemon restarts, use
unless-stopped. - Confirm that the policy was actually applied, and check the update command against your Engine version if it was changed after creation.
The container restarts repeatedly
- Inspect the application’s exit condition rather than treating restarts as a fix.
- Check whether the process exits before the documented 10-second successful-start threshold.
- Use
on-failure:Nwhen a bounded retry count is appropriate. - Check whether the memory ceiling is too low and causing out-of-memory termination.
Memory usage exceeds the reservation
That is not necessarily a configuration failure. A reservation is soft and is enforced as a pressure target, not as a hard maximum. The hard boundary is --memory. If usage reaches that ceiling, increase the limit only after verifying host capacity and application needs.
CPU usage is lower than expected
- A
--cpusvalue is a ceiling, so the container cannot exceed it even during a burst. - CPU shares affect distribution only when there is contention; they do not guarantee a fixed percentage.
- Host-level limits, kernel support and other containers can also affect scheduling.
Swap settings do not behave as expected
--memory-swap is a combined memory-plus-swap allowance, not a standalone swap guarantee. Verify that the host has usable swap and that the platform supports the requested cgroup controls. Behavior may differ across Linux Engine installations, Docker Desktop environments and other operating systems.
Platform and operations boundaries
The resource documentation focuses on Linux kernel and cgroup behavior. Some resource features require kernel support, and this guidance does not establish identical behavior across every Docker Engine release, Docker Desktop configuration or operating system. Check the documentation for the exact deployment target and installed version before depending on a specific flag.
Keep responsibility for restarts in one layer. Docker restart policies apply to containers; Swarm services and Kubernetes workloads have their own controllers and configuration models. Likewise, a host process manager may conflict with Docker’s policy if both attempt to supervise the same process. Choose one authority and document what a manual stop means for operators.
Quick Recap
Configuration checklist
- Have you selected
no,on-failure[:N],alwaysorunless-stoppedbased on an explicit failure scenario? - Do operators understand the 10-second successful-start condition and the effect of a manual stop?
- Is
--memoryhigh enough for measured peaks while protecting host capacity? - If you set
--memory-reservation, is it below the hard ceiling and treated as a soft target? - Does the host have the swap and kernel support required by your
--memory-swapplan? - Are you using
--cpusfor a true cap and--cpu-sharesonly for relative priority? - Have you watched
docker statsthrough representative load rather than relying on one snapshot? - Have you tested out-of-memory, CPU throttling, application crashes and daemon restarts before production?
- Is Docker the only restart authority for this container?
Official references
- Docker Docs: Start containers automatically — restart policies, startup conditions and manual-stop behavior.
- Docker Docs: Resource constraints — memory, swap, CPU controls, host risks and kernel requirements.
- Docker Docs: Running containers — run-time resource option reference and examples.
- Docker Docs: docker container update — changing settings on an existing container.
- Docker Docs: Runtime metrics — metrics exposed by
docker stats.
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

