误删除Weblogic 12c中的/tmp目录是否影响应用性能与功能?
Hey there, let's break down what happens when you delete the /tmp directory in WebLogic 12c and what impact it might have on your application's performance and functionality.
/tmp Directory What WebLogic Uses /tmp For
First, it's important to understand this directory's role:
- It's WebLogic's default storage for runtime temporary files: compiled JSPs, cached configuration resources, temporary session data, and deployment-related temp files all live here.
- Many third-party libraries or custom applications also rely on this directory if they use the system's default temp file location.
Immediate Impact (Before Restarting WebLogic)
If you delete /tmp while the server is running, you'll likely run into immediate issues:
- Functionality breaks: Any active processes using files in
/tmpwill throw errors—thinkFileNotFoundException, failed session operations, or broken JSP rendering (since compiled JSPs are stored here). - Performance dips: Cached resources that were stored in
/tmpwill need to be regenerated on the fly for incoming requests, which slows down response times until the cache is rebuilt.
Impact After Restarting WebLogic
Good news: WebLogic will automatically recreate the /tmp directory when it starts up. But you might still face some hiccups:
- Slower startup: The server will have to recompile all JSPs, rebuild cached configurations, and recreate essential temp files that were lost—this adds extra time to the startup process.
- Data loss: If your application stored non-persistent temporary data (like unprocessed file uploads) in
/tmp, that data is permanently gone. - Third-party component issues: Some custom or third-party tools might rely on specific files in
/tmpthat aren't automatically regenerated. You'll need to check logs for errors related to these components.
Long-Term Performance Implications
Once WebLogic has rebuilt all necessary temp files and caches, performance should return to normal. There's no permanent performance penalty as long as the directory is recreated and you have enough disk space for temp operations. That said, frequent deletions of /tmp without restarting can cause intermittent slowdowns from repeated cache regeneration.
Recommended Fixes & Mitigations
- Restart WebLogic: This is the first step—it triggers the automatic recreation of
/tmpand lets the server rebuild all runtime assets. - Scan application logs: Look for errors related to missing temp files or failed operations to identify if any custom components need manual fixes.
- Test JSP functionality: Verify that JSP-based pages render correctly, since their compiled versions were stored in
/tmp. - Set a custom temp directory (optional): To avoid accidental deletions in the future, configure a dedicated temp location using the
java.io.tmpdirJVM parameter in your server startup script.
内容的提问来源于stack exchange,提问作者Alberto Rojas Sáez

